2903 lines
101 KiB
JavaScript
2903 lines
101 KiB
JavaScript
/* PrismJS 1.29.0
|
||
https://prismjs.com/download.html#themes=prism-tomorrow&languages=markup+css+clike+javascript+arduino+bash+c+csharp+cpp+git+json+lua+markdown+markup-templating+php+python+ruby+yaml&plugins=line-highlight+line-numbers+command-line+normalize-whitespace */
|
||
var _self =
|
||
'undefined' != typeof window
|
||
? window
|
||
: 'undefined' != typeof WorkerGlobalScope &&
|
||
self instanceof WorkerGlobalScope
|
||
? self
|
||
: {},
|
||
Prism = (function (e) {
|
||
var n = /(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,
|
||
t = 0,
|
||
r = {},
|
||
a = {
|
||
manual: e.Prism && e.Prism.manual,
|
||
disableWorkerMessageHandler:
|
||
e.Prism && e.Prism.disableWorkerMessageHandler,
|
||
util: {
|
||
encode: function e(n) {
|
||
return n instanceof i
|
||
? new i(n.type, e(n.content), n.alias)
|
||
: Array.isArray(n)
|
||
? n.map(e)
|
||
: n
|
||
.replace(/&/g, '&')
|
||
.replace(/</g, '<')
|
||
.replace(/\u00a0/g, ' ')
|
||
},
|
||
type: function (e) {
|
||
return Object.prototype.toString.call(e).slice(8, -1)
|
||
},
|
||
objId: function (e) {
|
||
return (
|
||
e.__id || Object.defineProperty(e, '__id', { value: ++t }), e.__id
|
||
)
|
||
},
|
||
clone: function e(n, t) {
|
||
var r, i
|
||
switch (((t = t || {}), a.util.type(n))) {
|
||
case 'Object':
|
||
if (((i = a.util.objId(n)), t[i])) return t[i]
|
||
for (var l in ((r = {}), (t[i] = r), n))
|
||
n.hasOwnProperty(l) && (r[l] = e(n[l], t))
|
||
return r
|
||
case 'Array':
|
||
return (
|
||
(i = a.util.objId(n)),
|
||
t[i]
|
||
? t[i]
|
||
: ((r = []),
|
||
(t[i] = r),
|
||
n.forEach(function (n, a) {
|
||
r[a] = e(n, t)
|
||
}),
|
||
r)
|
||
)
|
||
default:
|
||
return n
|
||
}
|
||
},
|
||
getLanguage: function (e) {
|
||
for (; e; ) {
|
||
var t = n.exec(e.className)
|
||
if (t) return t[1].toLowerCase()
|
||
e = e.parentElement
|
||
}
|
||
return 'none'
|
||
},
|
||
setLanguage: function (e, t) {
|
||
;(e.className = e.className.replace(RegExp(n, 'gi'), '')),
|
||
e.classList.add('language-' + t)
|
||
},
|
||
currentScript: function () {
|
||
if ('undefined' == typeof document) return null
|
||
if ('currentScript' in document) return document.currentScript
|
||
try {
|
||
throw new Error()
|
||
} catch (r) {
|
||
var e = (/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(r.stack) ||
|
||
[])[1]
|
||
if (e) {
|
||
var n = document.getElementsByTagName('script')
|
||
for (var t in n) if (n[t].src == e) return n[t]
|
||
}
|
||
return null
|
||
}
|
||
},
|
||
isActive: function (e, n, t) {
|
||
for (var r = 'no-' + n; e; ) {
|
||
var a = e.classList
|
||
if (a.contains(n)) return !0
|
||
if (a.contains(r)) return !1
|
||
e = e.parentElement
|
||
}
|
||
return !!t
|
||
},
|
||
},
|
||
languages: {
|
||
plain: r,
|
||
plaintext: r,
|
||
text: r,
|
||
txt: r,
|
||
extend: function (e, n) {
|
||
var t = a.util.clone(a.languages[e])
|
||
for (var r in n) t[r] = n[r]
|
||
return t
|
||
},
|
||
insertBefore: function (e, n, t, r) {
|
||
var i = (r = r || a.languages)[e],
|
||
l = {}
|
||
for (var o in i)
|
||
if (i.hasOwnProperty(o)) {
|
||
if (o == n)
|
||
for (var s in t) t.hasOwnProperty(s) && (l[s] = t[s])
|
||
t.hasOwnProperty(o) || (l[o] = i[o])
|
||
}
|
||
var u = r[e]
|
||
return (
|
||
(r[e] = l),
|
||
a.languages.DFS(a.languages, function (n, t) {
|
||
t === u && n != e && (this[n] = l)
|
||
}),
|
||
l
|
||
)
|
||
},
|
||
DFS: function e(n, t, r, i) {
|
||
i = i || {}
|
||
var l = a.util.objId
|
||
for (var o in n)
|
||
if (n.hasOwnProperty(o)) {
|
||
t.call(n, o, n[o], r || o)
|
||
var s = n[o],
|
||
u = a.util.type(s)
|
||
'Object' !== u || i[l(s)]
|
||
? 'Array' !== u || i[l(s)] || ((i[l(s)] = !0), e(s, t, o, i))
|
||
: ((i[l(s)] = !0), e(s, t, null, i))
|
||
}
|
||
},
|
||
},
|
||
plugins: {},
|
||
highlightAll: function (e, n) {
|
||
a.highlightAllUnder(document, e, n)
|
||
},
|
||
highlightAllUnder: function (e, n, t) {
|
||
var r = {
|
||
callback: t,
|
||
container: e,
|
||
selector:
|
||
'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code',
|
||
}
|
||
a.hooks.run('before-highlightall', r),
|
||
(r.elements = Array.prototype.slice.apply(
|
||
r.container.querySelectorAll(r.selector)
|
||
)),
|
||
a.hooks.run('before-all-elements-highlight', r)
|
||
for (var i, l = 0; (i = r.elements[l++]); )
|
||
a.highlightElement(i, !0 === n, r.callback)
|
||
},
|
||
highlightElement: function (n, t, r) {
|
||
var i = a.util.getLanguage(n),
|
||
l = a.languages[i]
|
||
a.util.setLanguage(n, i)
|
||
var o = n.parentElement
|
||
o && 'pre' === o.nodeName.toLowerCase() && a.util.setLanguage(o, i)
|
||
var s = { element: n, language: i, grammar: l, code: n.textContent }
|
||
function u(e) {
|
||
;(s.highlightedCode = e),
|
||
a.hooks.run('before-insert', s),
|
||
(s.element.innerHTML = s.highlightedCode),
|
||
a.hooks.run('after-highlight', s),
|
||
a.hooks.run('complete', s),
|
||
r && r.call(s.element)
|
||
}
|
||
if (
|
||
(a.hooks.run('before-sanity-check', s),
|
||
(o = s.element.parentElement) &&
|
||
'pre' === o.nodeName.toLowerCase() &&
|
||
!o.hasAttribute('tabindex') &&
|
||
o.setAttribute('tabindex', '0'),
|
||
!s.code)
|
||
)
|
||
return a.hooks.run('complete', s), void (r && r.call(s.element))
|
||
if ((a.hooks.run('before-highlight', s), s.grammar))
|
||
if (t && e.Worker) {
|
||
var c = new Worker(a.filename)
|
||
;(c.onmessage = function (e) {
|
||
u(e.data)
|
||
}),
|
||
c.postMessage(
|
||
JSON.stringify({
|
||
language: s.language,
|
||
code: s.code,
|
||
immediateClose: !0,
|
||
})
|
||
)
|
||
} else u(a.highlight(s.code, s.grammar, s.language))
|
||
else u(a.util.encode(s.code))
|
||
},
|
||
highlight: function (e, n, t) {
|
||
var r = { code: e, grammar: n, language: t }
|
||
if ((a.hooks.run('before-tokenize', r), !r.grammar))
|
||
throw new Error('The language "' + r.language + '" has no grammar.')
|
||
return (
|
||
(r.tokens = a.tokenize(r.code, r.grammar)),
|
||
a.hooks.run('after-tokenize', r),
|
||
i.stringify(a.util.encode(r.tokens), r.language)
|
||
)
|
||
},
|
||
tokenize: function (e, n) {
|
||
var t = n.rest
|
||
if (t) {
|
||
for (var r in t) n[r] = t[r]
|
||
delete n.rest
|
||
}
|
||
var a = new s()
|
||
return (
|
||
u(a, a.head, e),
|
||
o(e, a, n, a.head, 0),
|
||
(function (e) {
|
||
for (var n = [], t = e.head.next; t !== e.tail; )
|
||
n.push(t.value), (t = t.next)
|
||
return n
|
||
})(a)
|
||
)
|
||
},
|
||
hooks: {
|
||
all: {},
|
||
add: function (e, n) {
|
||
var t = a.hooks.all
|
||
;(t[e] = t[e] || []), t[e].push(n)
|
||
},
|
||
run: function (e, n) {
|
||
var t = a.hooks.all[e]
|
||
if (t && t.length) for (var r, i = 0; (r = t[i++]); ) r(n)
|
||
},
|
||
},
|
||
Token: i,
|
||
}
|
||
function i(e, n, t, r) {
|
||
;(this.type = e),
|
||
(this.content = n),
|
||
(this.alias = t),
|
||
(this.length = 0 | (r || '').length)
|
||
}
|
||
function l(e, n, t, r) {
|
||
e.lastIndex = n
|
||
var a = e.exec(t)
|
||
if (a && r && a[1]) {
|
||
var i = a[1].length
|
||
;(a.index += i), (a[0] = a[0].slice(i))
|
||
}
|
||
return a
|
||
}
|
||
function o(e, n, t, r, s, g) {
|
||
for (var f in t)
|
||
if (t.hasOwnProperty(f) && t[f]) {
|
||
var h = t[f]
|
||
h = Array.isArray(h) ? h : [h]
|
||
for (var d = 0; d < h.length; ++d) {
|
||
if (g && g.cause == f + ',' + d) return
|
||
var v = h[d],
|
||
p = v.inside,
|
||
m = !!v.lookbehind,
|
||
y = !!v.greedy,
|
||
k = v.alias
|
||
if (y && !v.pattern.global) {
|
||
var x = v.pattern.toString().match(/[imsuy]*$/)[0]
|
||
v.pattern = RegExp(v.pattern.source, x + 'g')
|
||
}
|
||
for (
|
||
var b = v.pattern || v, w = r.next, A = s;
|
||
w !== n.tail && !(g && A >= g.reach);
|
||
A += w.value.length, w = w.next
|
||
) {
|
||
var E = w.value
|
||
if (n.length > e.length) return
|
||
if (!(E instanceof i)) {
|
||
var P,
|
||
L = 1
|
||
if (y) {
|
||
if (!(P = l(b, A, e, m)) || P.index >= e.length) break
|
||
var S = P.index,
|
||
O = P.index + P[0].length,
|
||
j = A
|
||
for (j += w.value.length; S >= j; )
|
||
j += (w = w.next).value.length
|
||
if (((A = j -= w.value.length), w.value instanceof i))
|
||
continue
|
||
for (
|
||
var C = w;
|
||
C !== n.tail && (j < O || 'string' == typeof C.value);
|
||
C = C.next
|
||
)
|
||
L++, (j += C.value.length)
|
||
L--, (E = e.slice(A, j)), (P.index -= A)
|
||
} else if (!(P = l(b, 0, E, m))) continue
|
||
S = P.index
|
||
var N = P[0],
|
||
_ = E.slice(0, S),
|
||
M = E.slice(S + N.length),
|
||
W = A + E.length
|
||
g && W > g.reach && (g.reach = W)
|
||
var z = w.prev
|
||
if (
|
||
(_ && ((z = u(n, z, _)), (A += _.length)),
|
||
c(n, z, L),
|
||
(w = u(n, z, new i(f, p ? a.tokenize(N, p) : N, k, N))),
|
||
M && u(n, w, M),
|
||
L > 1)
|
||
) {
|
||
var I = { cause: f + ',' + d, reach: W }
|
||
o(e, n, t, w.prev, A, I),
|
||
g && I.reach > g.reach && (g.reach = I.reach)
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
function s() {
|
||
var e = { value: null, prev: null, next: null },
|
||
n = { value: null, prev: e, next: null }
|
||
;(e.next = n), (this.head = e), (this.tail = n), (this.length = 0)
|
||
}
|
||
function u(e, n, t) {
|
||
var r = n.next,
|
||
a = { value: t, prev: n, next: r }
|
||
return (n.next = a), (r.prev = a), e.length++, a
|
||
}
|
||
function c(e, n, t) {
|
||
for (var r = n.next, a = 0; a < t && r !== e.tail; a++) r = r.next
|
||
;(n.next = r), (r.prev = n), (e.length -= a)
|
||
}
|
||
if (
|
||
((e.Prism = a),
|
||
(i.stringify = function e(n, t) {
|
||
if ('string' == typeof n) return n
|
||
if (Array.isArray(n)) {
|
||
var r = ''
|
||
return (
|
||
n.forEach(function (n) {
|
||
r += e(n, t)
|
||
}),
|
||
r
|
||
)
|
||
}
|
||
var i = {
|
||
type: n.type,
|
||
content: e(n.content, t),
|
||
tag: 'span',
|
||
classes: ['token', n.type],
|
||
attributes: {},
|
||
language: t,
|
||
},
|
||
l = n.alias
|
||
l &&
|
||
(Array.isArray(l)
|
||
? Array.prototype.push.apply(i.classes, l)
|
||
: i.classes.push(l)),
|
||
a.hooks.run('wrap', i)
|
||
var o = ''
|
||
for (var s in i.attributes)
|
||
o +=
|
||
' ' +
|
||
s +
|
||
'="' +
|
||
(i.attributes[s] || '').replace(/"/g, '"') +
|
||
'"'
|
||
return (
|
||
'<' +
|
||
i.tag +
|
||
' class="' +
|
||
i.classes.join(' ') +
|
||
'"' +
|
||
o +
|
||
'>' +
|
||
i.content +
|
||
'</' +
|
||
i.tag +
|
||
'>'
|
||
)
|
||
}),
|
||
!e.document)
|
||
)
|
||
return e.addEventListener
|
||
? (a.disableWorkerMessageHandler ||
|
||
e.addEventListener(
|
||
'message',
|
||
function (n) {
|
||
var t = JSON.parse(n.data),
|
||
r = t.language,
|
||
i = t.code,
|
||
l = t.immediateClose
|
||
e.postMessage(a.highlight(i, a.languages[r], r)), l && e.close()
|
||
},
|
||
!1
|
||
),
|
||
a)
|
||
: a
|
||
var g = a.util.currentScript()
|
||
function f() {
|
||
a.manual || a.highlightAll()
|
||
}
|
||
if (
|
||
(g &&
|
||
((a.filename = g.src),
|
||
g.hasAttribute('data-manual') && (a.manual = !0)),
|
||
!a.manual)
|
||
) {
|
||
var h = document.readyState
|
||
'loading' === h || ('interactive' === h && g && g.defer)
|
||
? document.addEventListener('DOMContentLoaded', f)
|
||
: window.requestAnimationFrame
|
||
? window.requestAnimationFrame(f)
|
||
: window.setTimeout(f, 16)
|
||
}
|
||
return a
|
||
})(_self)
|
||
'undefined' != typeof module && module.exports && (module.exports = Prism),
|
||
'undefined' != typeof global && (global.Prism = Prism)
|
||
;(Prism.languages.markup = {
|
||
comment: { pattern: /<!--(?:(?!<!--)[\s\S])*?-->/, greedy: !0 },
|
||
prolog: { pattern: /<\?[\s\S]+?\?>/, greedy: !0 },
|
||
doctype: {
|
||
pattern:
|
||
/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,
|
||
greedy: !0,
|
||
inside: {
|
||
'internal-subset': {
|
||
pattern: /(^[^\[]*\[)[\s\S]+(?=\]>$)/,
|
||
lookbehind: !0,
|
||
greedy: !0,
|
||
inside: null,
|
||
},
|
||
string: { pattern: /"[^"]*"|'[^']*'/, greedy: !0 },
|
||
punctuation: /^<!|>$|[[\]]/,
|
||
'doctype-tag': /^DOCTYPE/i,
|
||
name: /[^\s<>'"]+/,
|
||
},
|
||
},
|
||
cdata: { pattern: /<!\[CDATA\[[\s\S]*?\]\]>/i, greedy: !0 },
|
||
tag: {
|
||
pattern:
|
||
/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,
|
||
greedy: !0,
|
||
inside: {
|
||
tag: {
|
||
pattern: /^<\/?[^\s>\/]+/,
|
||
inside: { punctuation: /^<\/?/, namespace: /^[^\s>\/:]+:/ },
|
||
},
|
||
'special-attr': [],
|
||
'attr-value': {
|
||
pattern: /=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,
|
||
inside: {
|
||
punctuation: [
|
||
{ pattern: /^=/, alias: 'attr-equals' },
|
||
{ pattern: /^(\s*)["']|["']$/, lookbehind: !0 },
|
||
],
|
||
},
|
||
},
|
||
punctuation: /\/?>/,
|
||
'attr-name': {
|
||
pattern: /[^\s>\/]+/,
|
||
inside: { namespace: /^[^\s>\/:]+:/ },
|
||
},
|
||
},
|
||
},
|
||
entity: [
|
||
{ pattern: /&[\da-z]{1,8};/i, alias: 'named-entity' },
|
||
/&#x?[\da-f]{1,8};/i,
|
||
],
|
||
}),
|
||
(Prism.languages.markup.tag.inside['attr-value'].inside.entity =
|
||
Prism.languages.markup.entity),
|
||
(Prism.languages.markup.doctype.inside['internal-subset'].inside =
|
||
Prism.languages.markup),
|
||
Prism.hooks.add('wrap', function (a) {
|
||
'entity' === a.type &&
|
||
(a.attributes.title = a.content.replace(/&/, '&'))
|
||
}),
|
||
Object.defineProperty(Prism.languages.markup.tag, 'addInlined', {
|
||
value: function (a, e) {
|
||
var s = {}
|
||
;(s['language-' + e] = {
|
||
pattern: /(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,
|
||
lookbehind: !0,
|
||
inside: Prism.languages[e],
|
||
}),
|
||
(s.cdata = /^<!\[CDATA\[|\]\]>$/i)
|
||
var t = {
|
||
'included-cdata': { pattern: /<!\[CDATA\[[\s\S]*?\]\]>/i, inside: s },
|
||
}
|
||
t['language-' + e] = { pattern: /[\s\S]+/, inside: Prism.languages[e] }
|
||
var n = {}
|
||
;(n[a] = {
|
||
pattern: RegExp(
|
||
'(<__[^>]*>)(?:<!\\[CDATA\\[(?:[^\\]]|\\](?!\\]>))*\\]\\]>|(?!<!\\[CDATA\\[)[^])*?(?=</__>)'.replace(
|
||
/__/g,
|
||
function () {
|
||
return a
|
||
}
|
||
),
|
||
'i'
|
||
),
|
||
lookbehind: !0,
|
||
greedy: !0,
|
||
inside: t,
|
||
}),
|
||
Prism.languages.insertBefore('markup', 'cdata', n)
|
||
},
|
||
}),
|
||
Object.defineProperty(Prism.languages.markup.tag, 'addAttribute', {
|
||
value: function (a, e) {
|
||
Prism.languages.markup.tag.inside['special-attr'].push({
|
||
pattern: RegExp(
|
||
'(^|["\'\\s])(?:' +
|
||
a +
|
||
')\\s*=\\s*(?:"[^"]*"|\'[^\']*\'|[^\\s\'">=]+(?=[\\s>]))',
|
||
'i'
|
||
),
|
||
lookbehind: !0,
|
||
inside: {
|
||
'attr-name': /^[^\s=]+/,
|
||
'attr-value': {
|
||
pattern: /=[\s\S]+/,
|
||
inside: {
|
||
value: {
|
||
pattern: /(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,
|
||
lookbehind: !0,
|
||
alias: [e, 'language-' + e],
|
||
inside: Prism.languages[e],
|
||
},
|
||
punctuation: [{ pattern: /^=/, alias: 'attr-equals' }, /"|'/],
|
||
},
|
||
},
|
||
},
|
||
})
|
||
},
|
||
}),
|
||
(Prism.languages.html = Prism.languages.markup),
|
||
(Prism.languages.mathml = Prism.languages.markup),
|
||
(Prism.languages.svg = Prism.languages.markup),
|
||
(Prism.languages.xml = Prism.languages.extend('markup', {})),
|
||
(Prism.languages.ssml = Prism.languages.xml),
|
||
(Prism.languages.atom = Prism.languages.xml),
|
||
(Prism.languages.rss = Prism.languages.xml)
|
||
!(function (s) {
|
||
var e =
|
||
/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/
|
||
;(s.languages.css = {
|
||
comment: /\/\*[\s\S]*?\*\//,
|
||
atrule: {
|
||
pattern: RegExp(
|
||
'@[\\w-](?:[^;{\\s"\']|\\s+(?!\\s)|' + e.source + ')*?(?:;|(?=\\s*\\{))'
|
||
),
|
||
inside: {
|
||
rule: /^@[\w-]+/,
|
||
'selector-function-argument': {
|
||
pattern:
|
||
/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,
|
||
lookbehind: !0,
|
||
alias: 'selector',
|
||
},
|
||
keyword: {
|
||
pattern: /(^|[^\w-])(?:and|not|only|or)(?![\w-])/,
|
||
lookbehind: !0,
|
||
},
|
||
},
|
||
},
|
||
url: {
|
||
pattern: RegExp(
|
||
'\\burl\\((?:' + e.source + '|(?:[^\\\\\r\n()"\']|\\\\[^])*)\\)',
|
||
'i'
|
||
),
|
||
greedy: !0,
|
||
inside: {
|
||
function: /^url/i,
|
||
punctuation: /^\(|\)$/,
|
||
string: { pattern: RegExp('^' + e.source + '$'), alias: 'url' },
|
||
},
|
||
},
|
||
selector: {
|
||
pattern: RegExp(
|
||
'(^|[{}\\s])[^{}\\s](?:[^{};"\'\\s]|\\s+(?![\\s{])|' +
|
||
e.source +
|
||
')*(?=\\s*\\{)'
|
||
),
|
||
lookbehind: !0,
|
||
},
|
||
string: { pattern: e, greedy: !0 },
|
||
property: {
|
||
pattern:
|
||
/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,
|
||
lookbehind: !0,
|
||
},
|
||
important: /!important\b/i,
|
||
function: { pattern: /(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i, lookbehind: !0 },
|
||
punctuation: /[(){};:,]/,
|
||
}),
|
||
(s.languages.css.atrule.inside.rest = s.languages.css)
|
||
var t = s.languages.markup
|
||
t && (t.tag.addInlined('style', 'css'), t.tag.addAttribute('style', 'css'))
|
||
})(Prism)
|
||
Prism.languages.clike = {
|
||
comment: [
|
||
{ pattern: /(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/, lookbehind: !0, greedy: !0 },
|
||
{ pattern: /(^|[^\\:])\/\/.*/, lookbehind: !0, greedy: !0 },
|
||
],
|
||
string: {
|
||
pattern: /(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,
|
||
greedy: !0,
|
||
},
|
||
'class-name': {
|
||
pattern:
|
||
/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,
|
||
lookbehind: !0,
|
||
inside: { punctuation: /[.\\]/ },
|
||
},
|
||
keyword:
|
||
/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,
|
||
boolean: /\b(?:false|true)\b/,
|
||
function: /\b\w+(?=\()/,
|
||
number: /\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,
|
||
operator: /[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,
|
||
punctuation: /[{}[\];(),.:]/,
|
||
}
|
||
;(Prism.languages.javascript = Prism.languages.extend('clike', {
|
||
'class-name': [
|
||
Prism.languages.clike['class-name'],
|
||
{
|
||
pattern:
|
||
/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,
|
||
lookbehind: !0,
|
||
},
|
||
],
|
||
keyword: [
|
||
{ pattern: /((?:^|\})\s*)catch\b/, lookbehind: !0 },
|
||
{
|
||
pattern:
|
||
/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,
|
||
lookbehind: !0,
|
||
},
|
||
],
|
||
function:
|
||
/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,
|
||
number: {
|
||
pattern: RegExp(
|
||
'(^|[^\\w$])(?:NaN|Infinity|0[bB][01]+(?:_[01]+)*n?|0[oO][0-7]+(?:_[0-7]+)*n?|0[xX][\\dA-Fa-f]+(?:_[\\dA-Fa-f]+)*n?|\\d+(?:_\\d+)*n|(?:\\d+(?:_\\d+)*(?:\\.(?:\\d+(?:_\\d+)*)?)?|\\.\\d+(?:_\\d+)*)(?:[Ee][+-]?\\d+(?:_\\d+)*)?)(?![\\w$])'
|
||
),
|
||
lookbehind: !0,
|
||
},
|
||
operator:
|
||
/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/,
|
||
})),
|
||
(Prism.languages.javascript['class-name'][0].pattern =
|
||
/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/),
|
||
Prism.languages.insertBefore('javascript', 'keyword', {
|
||
regex: {
|
||
pattern: RegExp(
|
||
'((?:^|[^$\\w\\xA0-\\uFFFF."\'\\])\\s]|\\b(?:return|yield))\\s*)/(?:(?:\\[(?:[^\\]\\\\\r\n]|\\\\.)*\\]|\\\\.|[^/\\\\\\[\r\n])+/[dgimyus]{0,7}|(?:\\[(?:[^[\\]\\\\\r\n]|\\\\.|\\[(?:[^[\\]\\\\\r\n]|\\\\.|\\[(?:[^[\\]\\\\\r\n]|\\\\.)*\\])*\\])*\\]|\\\\.|[^/\\\\\\[\r\n])+/[dgimyus]{0,7}v[dgimyus]{0,7})(?=(?:\\s|/\\*(?:[^*]|\\*(?!/))*\\*/)*(?:$|[\r\n,.;:})\\]]|//))'
|
||
),
|
||
lookbehind: !0,
|
||
greedy: !0,
|
||
inside: {
|
||
'regex-source': {
|
||
pattern: /^(\/)[\s\S]+(?=\/[a-z]*$)/,
|
||
lookbehind: !0,
|
||
alias: 'language-regex',
|
||
inside: Prism.languages.regex,
|
||
},
|
||
'regex-delimiter': /^\/|\/$/,
|
||
'regex-flags': /^[a-z]+$/,
|
||
},
|
||
},
|
||
'function-variable': {
|
||
pattern:
|
||
/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,
|
||
alias: 'function',
|
||
},
|
||
parameter: [
|
||
{
|
||
pattern:
|
||
/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,
|
||
lookbehind: !0,
|
||
inside: Prism.languages.javascript,
|
||
},
|
||
{
|
||
pattern:
|
||
/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,
|
||
lookbehind: !0,
|
||
inside: Prism.languages.javascript,
|
||
},
|
||
{
|
||
pattern:
|
||
/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,
|
||
lookbehind: !0,
|
||
inside: Prism.languages.javascript,
|
||
},
|
||
{
|
||
pattern:
|
||
/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,
|
||
lookbehind: !0,
|
||
inside: Prism.languages.javascript,
|
||
},
|
||
],
|
||
constant: /\b[A-Z](?:[A-Z_]|\dx?)*\b/,
|
||
}),
|
||
Prism.languages.insertBefore('javascript', 'string', {
|
||
hashbang: { pattern: /^#!.*/, greedy: !0, alias: 'comment' },
|
||
'template-string': {
|
||
pattern:
|
||
/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,
|
||
greedy: !0,
|
||
inside: {
|
||
'template-punctuation': { pattern: /^`|`$/, alias: 'string' },
|
||
interpolation: {
|
||
pattern:
|
||
/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,
|
||
lookbehind: !0,
|
||
inside: {
|
||
'interpolation-punctuation': {
|
||
pattern: /^\$\{|\}$/,
|
||
alias: 'punctuation',
|
||
},
|
||
rest: Prism.languages.javascript,
|
||
},
|
||
},
|
||
string: /[\s\S]+/,
|
||
},
|
||
},
|
||
'string-property': {
|
||
pattern:
|
||
/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,
|
||
lookbehind: !0,
|
||
greedy: !0,
|
||
alias: 'property',
|
||
},
|
||
}),
|
||
Prism.languages.insertBefore('javascript', 'operator', {
|
||
'literal-property': {
|
||
pattern:
|
||
/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,
|
||
lookbehind: !0,
|
||
alias: 'property',
|
||
},
|
||
}),
|
||
Prism.languages.markup &&
|
||
(Prism.languages.markup.tag.addInlined('script', 'javascript'),
|
||
Prism.languages.markup.tag.addAttribute(
|
||
'on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)',
|
||
'javascript'
|
||
)),
|
||
(Prism.languages.js = Prism.languages.javascript)
|
||
;(Prism.languages.c = Prism.languages.extend('clike', {
|
||
comment: {
|
||
pattern:
|
||
/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,
|
||
greedy: !0,
|
||
},
|
||
string: { pattern: /"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/, greedy: !0 },
|
||
'class-name': {
|
||
pattern:
|
||
/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,
|
||
lookbehind: !0,
|
||
},
|
||
keyword:
|
||
/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,
|
||
function: /\b[a-z_]\w*(?=\s*\()/i,
|
||
number:
|
||
/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,
|
||
operator: />>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/,
|
||
})),
|
||
Prism.languages.insertBefore('c', 'string', {
|
||
char: { pattern: /'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/, greedy: !0 },
|
||
}),
|
||
Prism.languages.insertBefore('c', 'string', {
|
||
macro: {
|
||
pattern:
|
||
/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,
|
||
lookbehind: !0,
|
||
greedy: !0,
|
||
alias: 'property',
|
||
inside: {
|
||
string: [
|
||
{ pattern: /^(#\s*include\s*)<[^>]+>/, lookbehind: !0 },
|
||
Prism.languages.c.string,
|
||
],
|
||
char: Prism.languages.c.char,
|
||
comment: Prism.languages.c.comment,
|
||
'macro-name': [
|
||
{ pattern: /(^#\s*define\s+)\w+\b(?!\()/i, lookbehind: !0 },
|
||
{
|
||
pattern: /(^#\s*define\s+)\w+\b(?=\()/i,
|
||
lookbehind: !0,
|
||
alias: 'function',
|
||
},
|
||
],
|
||
directive: {
|
||
pattern: /^(#\s*)[a-z]+/,
|
||
lookbehind: !0,
|
||
alias: 'keyword',
|
||
},
|
||
'directive-hash': /^#/,
|
||
punctuation: /##|\\(?=[\r\n])/,
|
||
expression: { pattern: /\S[\s\S]*/, inside: Prism.languages.c },
|
||
},
|
||
},
|
||
}),
|
||
Prism.languages.insertBefore('c', 'function', {
|
||
constant:
|
||
/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/,
|
||
}),
|
||
delete Prism.languages.c.boolean
|
||
!(function (e) {
|
||
var t =
|
||
/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,
|
||
n = '\\b(?!<keyword>)\\w+(?:\\s*\\.\\s*\\w+)*\\b'.replace(
|
||
/<keyword>/g,
|
||
function () {
|
||
return t.source
|
||
}
|
||
)
|
||
;(e.languages.cpp = e.languages.extend('c', {
|
||
'class-name': [
|
||
{
|
||
pattern: RegExp(
|
||
'(\\b(?:class|concept|enum|struct|typename)\\s+)(?!<keyword>)\\w+'.replace(
|
||
/<keyword>/g,
|
||
function () {
|
||
return t.source
|
||
}
|
||
)
|
||
),
|
||
lookbehind: !0,
|
||
},
|
||
/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,
|
||
/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,
|
||
/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/,
|
||
],
|
||
keyword: t,
|
||
number: {
|
||
pattern:
|
||
/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,
|
||
greedy: !0,
|
||
},
|
||
operator:
|
||
/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,
|
||
boolean: /\b(?:false|true)\b/,
|
||
})),
|
||
e.languages.insertBefore('cpp', 'string', {
|
||
module: {
|
||
pattern: RegExp(
|
||
'(\\b(?:import|module)\\s+)(?:"(?:\\\\(?:\r\n|[^])|[^"\\\\\r\n])*"|<[^<>\r\n]*>|' +
|
||
'<mod-name>(?:\\s*:\\s*<mod-name>)?|:\\s*<mod-name>'.replace(
|
||
/<mod-name>/g,
|
||
function () {
|
||
return n
|
||
}
|
||
) +
|
||
')'
|
||
),
|
||
lookbehind: !0,
|
||
greedy: !0,
|
||
inside: { string: /^[<"][\s\S]+/, operator: /:/, punctuation: /\./ },
|
||
},
|
||
'raw-string': {
|
||
pattern: /R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,
|
||
alias: 'string',
|
||
greedy: !0,
|
||
},
|
||
}),
|
||
e.languages.insertBefore('cpp', 'keyword', {
|
||
'generic-function': {
|
||
pattern: /\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,
|
||
inside: {
|
||
function: /^\w+/,
|
||
generic: {
|
||
pattern: /<[\s\S]+/,
|
||
alias: 'class-name',
|
||
inside: e.languages.cpp,
|
||
},
|
||
},
|
||
},
|
||
}),
|
||
e.languages.insertBefore('cpp', 'operator', {
|
||
'double-colon': { pattern: /::/, alias: 'punctuation' },
|
||
}),
|
||
e.languages.insertBefore('cpp', 'class-name', {
|
||
'base-clause': {
|
||
pattern:
|
||
/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,
|
||
lookbehind: !0,
|
||
greedy: !0,
|
||
inside: e.languages.extend('cpp', {}),
|
||
},
|
||
}),
|
||
e.languages.insertBefore(
|
||
'inside',
|
||
'double-colon',
|
||
{ 'class-name': /\b[a-z_]\w*\b(?!\s*::)/i },
|
||
e.languages.cpp['base-clause']
|
||
)
|
||
})(Prism)
|
||
;(Prism.languages.arduino = Prism.languages.extend('cpp', {
|
||
keyword:
|
||
/\b(?:String|array|bool|boolean|break|byte|case|catch|continue|default|do|double|else|finally|for|function|goto|if|in|instanceof|int|integer|long|loop|new|null|return|setup|string|switch|throw|try|void|while|word)\b/,
|
||
constant:
|
||
/\b(?:ANALOG_MESSAGE|DEFAULT|DIGITAL_MESSAGE|EXTERNAL|FIRMATA_STRING|HIGH|INPUT|INPUT_PULLUP|INTERNAL|INTERNAL1V1|INTERNAL2V56|LED_BUILTIN|LOW|OUTPUT|REPORT_ANALOG|REPORT_DIGITAL|SET_PIN_MODE|SYSEX_START|SYSTEM_RESET)\b/,
|
||
builtin:
|
||
/\b(?:Audio|BSSID|Bridge|Client|Console|EEPROM|Esplora|EsploraTFT|Ethernet|EthernetClient|EthernetServer|EthernetUDP|File|FileIO|FileSystem|Firmata|GPRS|GSM|GSMBand|GSMClient|GSMModem|GSMPIN|GSMScanner|GSMServer|GSMVoiceCall|GSM_SMS|HttpClient|IPAddress|IRread|Keyboard|KeyboardController|LiquidCrystal|LiquidCrystal_I2C|Mailbox|Mouse|MouseController|PImage|Process|RSSI|RobotControl|RobotMotor|SD|SPI|SSID|Scheduler|Serial|Server|Servo|SoftwareSerial|Stepper|Stream|TFT|Task|USBHost|WiFi|WiFiClient|WiFiServer|WiFiUDP|Wire|YunClient|YunServer|abs|addParameter|analogRead|analogReadResolution|analogReference|analogWrite|analogWriteResolution|answerCall|attach|attachGPRS|attachInterrupt|attached|autoscroll|available|background|beep|begin|beginPacket|beginSD|beginSMS|beginSpeaker|beginTFT|beginTransmission|beginWrite|bit|bitClear|bitRead|bitSet|bitWrite|blink|blinkVersion|buffer|changePIN|checkPIN|checkPUK|checkReg|circle|cityNameRead|cityNameWrite|clear|clearScreen|click|close|compassRead|config|connect|connected|constrain|cos|countryNameRead|countryNameWrite|createChar|cursor|debugPrint|delay|delayMicroseconds|detach|detachInterrupt|digitalRead|digitalWrite|disconnect|display|displayLogos|drawBMP|drawCompass|encryptionType|end|endPacket|endSMS|endTransmission|endWrite|exists|exitValue|fill|find|findUntil|flush|gatewayIP|get|getAsynchronously|getBand|getButton|getCurrentCarrier|getIMEI|getKey|getModifiers|getOemKey|getPINUsed|getResult|getSignalStrength|getSocket|getVoiceCallStatus|getXChange|getYChange|hangCall|height|highByte|home|image|interrupts|isActionDone|isDirectory|isListening|isPIN|isPressed|isValid|keyPressed|keyReleased|keyboardRead|knobRead|leftToRight|line|lineFollowConfig|listen|listenOnLocalhost|loadImage|localIP|lowByte|macAddress|maintain|map|max|messageAvailable|micros|millis|min|mkdir|motorsStop|motorsWrite|mouseDragged|mouseMoved|mousePressed|mouseReleased|move|noAutoscroll|noBlink|noBuffer|noCursor|noDisplay|noFill|noInterrupts|noListenOnLocalhost|noStroke|noTone|onReceive|onRequest|open|openNextFile|overflow|parseCommand|parseFloat|parseInt|parsePacket|pauseMode|peek|pinMode|playFile|playMelody|point|pointTo|position|pow|prepare|press|print|printFirmwareVersion|printVersion|println|process|processInput|pulseIn|put|random|randomSeed|read|readAccelerometer|readBlue|readButton|readBytes|readBytesUntil|readGreen|readJoystickButton|readJoystickSwitch|readJoystickX|readJoystickY|readLightSensor|readMessage|readMicrophone|readNetworks|readRed|readSlider|readString|readStringUntil|readTemperature|ready|rect|release|releaseAll|remoteIP|remoteNumber|remotePort|remove|requestFrom|retrieveCallingNumber|rewindDirectory|rightToLeft|rmdir|robotNameRead|robotNameWrite|run|runAsynchronously|runShellCommand|runShellCommandAsynchronously|running|scanNetworks|scrollDisplayLeft|scrollDisplayRight|seek|sendAnalog|sendDigitalPortPair|sendDigitalPorts|sendString|sendSysex|serialEvent|setBand|setBitOrder|setClockDivider|setCursor|setDNS|setDataMode|setFirmwareVersion|setMode|setPINUsed|setSpeed|setTextSize|setTimeout|shiftIn|shiftOut|shutdown|sin|size|sqrt|startLoop|step|stop|stroke|subnetMask|switchPIN|tan|tempoWrite|text|tone|transfer|tuneWrite|turn|updateIR|userNameRead|userNameWrite|voiceCall|waitContinue|width|write|writeBlue|writeGreen|writeJSON|writeMessage|writeMicroseconds|writeRGB|writeRed|yield)\b/,
|
||
})),
|
||
(Prism.languages.ino = Prism.languages.arduino)
|
||
!(function (e) {
|
||
var t =
|
||
'\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_ADDRESS|LC_ALL|LC_IDENTIFICATION|LC_MEASUREMENT|LC_MONETARY|LC_NAME|LC_NUMERIC|LC_PAPER|LC_TELEPHONE|LC_TIME|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS1|PS2|PS3|PS4|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UID|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_CONFIG_DIRS|XDG_CURRENT_DESKTOP|XDG_DATA_DIRS|XDG_GREETER_DATA_DIR|XDG_MENU_PREFIX|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SEAT_PATH|XDG_SESSION_DESKTOP|XDG_SESSION_ID|XDG_SESSION_PATH|XDG_SESSION_TYPE|XDG_VTNR|XMODIFIERS)\\b',
|
||
a = {
|
||
pattern: /(^(["']?)\w+\2)[ \t]+\S.*/,
|
||
lookbehind: !0,
|
||
alias: 'punctuation',
|
||
inside: null,
|
||
},
|
||
n = {
|
||
bash: a,
|
||
environment: { pattern: RegExp('\\$' + t), alias: 'constant' },
|
||
variable: [
|
||
{
|
||
pattern: /\$?\(\([\s\S]+?\)\)/,
|
||
greedy: !0,
|
||
inside: {
|
||
variable: [
|
||
{ pattern: /(^\$\(\([\s\S]+)\)\)/, lookbehind: !0 },
|
||
/^\$\(\(/,
|
||
],
|
||
number:
|
||
/\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee]-?\d+)?/,
|
||
operator:
|
||
/--|\+\+|\*\*=?|<<=?|>>=?|&&|\|\||[=!+\-*/%<>^&|]=?|[?~:]/,
|
||
punctuation: /\(\(?|\)\)?|,|;/,
|
||
},
|
||
},
|
||
{
|
||
pattern: /\$\((?:\([^)]+\)|[^()])+\)|`[^`]+`/,
|
||
greedy: !0,
|
||
inside: { variable: /^\$\(|^`|\)$|`$/ },
|
||
},
|
||
{
|
||
pattern: /\$\{[^}]+\}/,
|
||
greedy: !0,
|
||
inside: {
|
||
operator: /:[-=?+]?|[!\/]|##?|%%?|\^\^?|,,?/,
|
||
punctuation: /[\[\]]/,
|
||
environment: {
|
||
pattern: RegExp('(\\{)' + t),
|
||
lookbehind: !0,
|
||
alias: 'constant',
|
||
},
|
||
},
|
||
},
|
||
/\$(?:\w+|[#?*!@$])/,
|
||
],
|
||
entity:
|
||
/\\(?:[abceEfnrtv\\"]|O?[0-7]{1,3}|U[0-9a-fA-F]{8}|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{1,2})/,
|
||
}
|
||
;(e.languages.bash = {
|
||
shebang: { pattern: /^#!\s*\/.*/, alias: 'important' },
|
||
comment: { pattern: /(^|[^"{\\$])#.*/, lookbehind: !0 },
|
||
'function-name': [
|
||
{
|
||
pattern: /(\bfunction\s+)[\w-]+(?=(?:\s*\(?:\s*\))?\s*\{)/,
|
||
lookbehind: !0,
|
||
alias: 'function',
|
||
},
|
||
{ pattern: /\b[\w-]+(?=\s*\(\s*\)\s*\{)/, alias: 'function' },
|
||
],
|
||
'for-or-select': {
|
||
pattern: /(\b(?:for|select)\s+)\w+(?=\s+in\s)/,
|
||
alias: 'variable',
|
||
lookbehind: !0,
|
||
},
|
||
'assign-left': {
|
||
pattern: /(^|[\s;|&]|[<>]\()\w+(?:\.\w+)*(?=\+?=)/,
|
||
inside: {
|
||
environment: {
|
||
pattern: RegExp('(^|[\\s;|&]|[<>]\\()' + t),
|
||
lookbehind: !0,
|
||
alias: 'constant',
|
||
},
|
||
},
|
||
alias: 'variable',
|
||
lookbehind: !0,
|
||
},
|
||
parameter: {
|
||
pattern: /(^|\s)-{1,2}(?:\w+:[+-]?)?\w+(?:\.\w+)*(?=[=\s]|$)/,
|
||
alias: 'variable',
|
||
lookbehind: !0,
|
||
},
|
||
string: [
|
||
{
|
||
pattern: /((?:^|[^<])<<-?\s*)(\w+)\s[\s\S]*?(?:\r?\n|\r)\2/,
|
||
lookbehind: !0,
|
||
greedy: !0,
|
||
inside: n,
|
||
},
|
||
{
|
||
pattern: /((?:^|[^<])<<-?\s*)(["'])(\w+)\2\s[\s\S]*?(?:\r?\n|\r)\3/,
|
||
lookbehind: !0,
|
||
greedy: !0,
|
||
inside: { bash: a },
|
||
},
|
||
{
|
||
pattern:
|
||
/(^|[^\\](?:\\\\)*)"(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|[^"\\`$])*"/,
|
||
lookbehind: !0,
|
||
greedy: !0,
|
||
inside: n,
|
||
},
|
||
{ pattern: /(^|[^$\\])'[^']*'/, lookbehind: !0, greedy: !0 },
|
||
{
|
||
pattern: /\$'(?:[^'\\]|\\[\s\S])*'/,
|
||
greedy: !0,
|
||
inside: { entity: n.entity },
|
||
},
|
||
],
|
||
environment: { pattern: RegExp('\\$?' + t), alias: 'constant' },
|
||
variable: n.variable,
|
||
function: {
|
||
pattern:
|
||
/(^|[\s;|&]|[<>]\()(?:add|apropos|apt|apt-cache|apt-get|aptitude|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cargo|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|docker|docker-compose|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|java|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|node|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|podman|podman-compose|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|sysctl|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vcpkg|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/,
|
||
lookbehind: !0,
|
||
},
|
||
keyword: {
|
||
pattern:
|
||
/(^|[\s;|&]|[<>]\()(?:case|do|done|elif|else|esac|fi|for|function|if|in|select|then|until|while)(?=$|[)\s;|&])/,
|
||
lookbehind: !0,
|
||
},
|
||
builtin: {
|
||
pattern:
|
||
/(^|[\s;|&]|[<>]\()(?:\.|:|alias|bind|break|builtin|caller|cd|command|continue|declare|echo|enable|eval|exec|exit|export|getopts|hash|help|let|local|logout|mapfile|printf|pwd|read|readarray|readonly|return|set|shift|shopt|source|test|times|trap|type|typeset|ulimit|umask|unalias|unset)(?=$|[)\s;|&])/,
|
||
lookbehind: !0,
|
||
alias: 'class-name',
|
||
},
|
||
boolean: {
|
||
pattern: /(^|[\s;|&]|[<>]\()(?:false|true)(?=$|[)\s;|&])/,
|
||
lookbehind: !0,
|
||
},
|
||
'file-descriptor': { pattern: /\B&\d\b/, alias: 'important' },
|
||
operator: {
|
||
pattern:
|
||
/\d?<>|>\||\+=|=[=~]?|!=?|<<[<-]?|[&\d]?>>|\d[<>]&?|[<>][&=]?|&[>&]?|\|[&|]?/,
|
||
inside: { 'file-descriptor': { pattern: /^\d/, alias: 'important' } },
|
||
},
|
||
punctuation: /\$?\(\(?|\)\)?|\.\.|[{}[\];\\]/,
|
||
number: { pattern: /(^|\s)(?:[1-9]\d*|0)(?:[.,]\d+)?\b/, lookbehind: !0 },
|
||
}),
|
||
(a.inside = e.languages.bash)
|
||
for (
|
||
var s = [
|
||
'comment',
|
||
'function-name',
|
||
'for-or-select',
|
||
'assign-left',
|
||
'parameter',
|
||
'string',
|
||
'environment',
|
||
'function',
|
||
'keyword',
|
||
'builtin',
|
||
'boolean',
|
||
'file-descriptor',
|
||
'operator',
|
||
'punctuation',
|
||
'number',
|
||
],
|
||
o = n.variable[1].inside,
|
||
i = 0;
|
||
i < s.length;
|
||
i++
|
||
)
|
||
o[s[i]] = e.languages.bash[s[i]]
|
||
;(e.languages.sh = e.languages.bash), (e.languages.shell = e.languages.bash)
|
||
})(Prism)
|
||
!(function (e) {
|
||
function n(e, n) {
|
||
return e.replace(/<<(\d+)>>/g, function (e, s) {
|
||
return '(?:' + n[+s] + ')'
|
||
})
|
||
}
|
||
function s(e, s, a) {
|
||
return RegExp(n(e, s), a || '')
|
||
}
|
||
function a(e, n) {
|
||
for (var s = 0; s < n; s++)
|
||
e = e.replace(/<<self>>/g, function () {
|
||
return '(?:' + e + ')'
|
||
})
|
||
return e.replace(/<<self>>/g, '[^\\s\\S]')
|
||
}
|
||
var t =
|
||
'bool byte char decimal double dynamic float int long object sbyte short string uint ulong ushort var void',
|
||
r = 'class enum interface record struct',
|
||
i =
|
||
'add alias and ascending async await by descending from(?=\\s*(?:\\w|$)) get global group into init(?=\\s*;) join let nameof not notnull on or orderby partial remove select set unmanaged value when where with(?=\\s*{)',
|
||
o =
|
||
'abstract as base break case catch checked const continue default delegate do else event explicit extern finally fixed for foreach goto if implicit in internal is lock namespace new null operator out override params private protected public readonly ref return sealed sizeof stackalloc static switch this throw try typeof unchecked unsafe using virtual volatile while yield'
|
||
function l(e) {
|
||
return '\\b(?:' + e.trim().replace(/ /g, '|') + ')\\b'
|
||
}
|
||
var d = l(r),
|
||
p = RegExp(l(t + ' ' + r + ' ' + i + ' ' + o)),
|
||
c = l(r + ' ' + i + ' ' + o),
|
||
u = l(t + ' ' + r + ' ' + o),
|
||
g = a('<(?:[^<>;=+\\-*/%&|^]|<<self>>)*>', 2),
|
||
b = a('\\((?:[^()]|<<self>>)*\\)', 2),
|
||
h = '@?\\b[A-Za-z_]\\w*\\b',
|
||
f = n('<<0>>(?:\\s*<<1>>)?', [h, g]),
|
||
m = n('(?!<<0>>)<<1>>(?:\\s*\\.\\s*<<1>>)*', [c, f]),
|
||
k = '\\[\\s*(?:,\\s*)*\\]',
|
||
y = n('<<0>>(?:\\s*(?:\\?\\s*)?<<1>>)*(?:\\s*\\?)?', [m, k]),
|
||
w = n('[^,()<>[\\];=+\\-*/%&|^]|<<0>>|<<1>>|<<2>>', [g, b, k]),
|
||
v = n('\\(<<0>>+(?:,<<0>>+)+\\)', [w]),
|
||
x = n('(?:<<0>>|<<1>>)(?:\\s*(?:\\?\\s*)?<<2>>)*(?:\\s*\\?)?', [v, m, k]),
|
||
$ = { keyword: p, punctuation: /[<>()?,.:[\]]/ },
|
||
_ = "'(?:[^\r\n'\\\\]|\\\\.|\\\\[Uux][\\da-fA-F]{1,8})'",
|
||
B = '"(?:\\\\.|[^\\\\"\r\n])*"'
|
||
;(e.languages.csharp = e.languages.extend('clike', {
|
||
string: [
|
||
{
|
||
pattern: s('(^|[^$\\\\])<<0>>', ['@"(?:""|\\\\[^]|[^\\\\"])*"(?!")']),
|
||
lookbehind: !0,
|
||
greedy: !0,
|
||
},
|
||
{ pattern: s('(^|[^@$\\\\])<<0>>', [B]), lookbehind: !0, greedy: !0 },
|
||
],
|
||
'class-name': [
|
||
{
|
||
pattern: s('(\\busing\\s+static\\s+)<<0>>(?=\\s*;)', [m]),
|
||
lookbehind: !0,
|
||
inside: $,
|
||
},
|
||
{
|
||
pattern: s('(\\busing\\s+<<0>>\\s*=\\s*)<<1>>(?=\\s*;)', [h, x]),
|
||
lookbehind: !0,
|
||
inside: $,
|
||
},
|
||
{ pattern: s('(\\busing\\s+)<<0>>(?=\\s*=)', [h]), lookbehind: !0 },
|
||
{ pattern: s('(\\b<<0>>\\s+)<<1>>', [d, f]), lookbehind: !0, inside: $ },
|
||
{
|
||
pattern: s('(\\bcatch\\s*\\(\\s*)<<0>>', [m]),
|
||
lookbehind: !0,
|
||
inside: $,
|
||
},
|
||
{ pattern: s('(\\bwhere\\s+)<<0>>', [h]), lookbehind: !0 },
|
||
{
|
||
pattern: s('(\\b(?:is(?:\\s+not)?|as)\\s+)<<0>>', [y]),
|
||
lookbehind: !0,
|
||
inside: $,
|
||
},
|
||
{
|
||
pattern: s(
|
||
'\\b<<0>>(?=\\s+(?!<<1>>|with\\s*\\{)<<2>>(?:\\s*[=,;:{)\\]]|\\s+(?:in|when)\\b))',
|
||
[x, u, h]
|
||
),
|
||
inside: $,
|
||
},
|
||
],
|
||
keyword: p,
|
||
number:
|
||
/(?:\b0(?:x[\da-f_]*[\da-f]|b[01_]*[01])|(?:\B\.\d+(?:_+\d+)*|\b\d+(?:_+\d+)*(?:\.\d+(?:_+\d+)*)?)(?:e[-+]?\d+(?:_+\d+)*)?)(?:[dflmu]|lu|ul)?\b/i,
|
||
operator: />>=?|<<=?|[-=]>|([-+&|])\1|~|\?\?=?|[-+*/%&|^!=<>]=?/,
|
||
punctuation: /\?\.?|::|[{}[\];(),.:]/,
|
||
})),
|
||
e.languages.insertBefore('csharp', 'number', {
|
||
range: { pattern: /\.\./, alias: 'operator' },
|
||
}),
|
||
e.languages.insertBefore('csharp', 'punctuation', {
|
||
'named-parameter': {
|
||
pattern: s('([(,]\\s*)<<0>>(?=\\s*:)', [h]),
|
||
lookbehind: !0,
|
||
alias: 'punctuation',
|
||
},
|
||
}),
|
||
e.languages.insertBefore('csharp', 'class-name', {
|
||
namespace: {
|
||
pattern: s(
|
||
'(\\b(?:namespace|using)\\s+)<<0>>(?:\\s*\\.\\s*<<0>>)*(?=\\s*[;{])',
|
||
[h]
|
||
),
|
||
lookbehind: !0,
|
||
inside: { punctuation: /\./ },
|
||
},
|
||
'type-expression': {
|
||
pattern: s(
|
||
'(\\b(?:default|sizeof|typeof)\\s*\\(\\s*(?!\\s))(?:[^()\\s]|\\s(?!\\s)|<<0>>)*(?=\\s*\\))',
|
||
[b]
|
||
),
|
||
lookbehind: !0,
|
||
alias: 'class-name',
|
||
inside: $,
|
||
},
|
||
'return-type': {
|
||
pattern: s(
|
||
'<<0>>(?=\\s+(?:<<1>>\\s*(?:=>|[({]|\\.\\s*this\\s*\\[)|this\\s*\\[))',
|
||
[x, m]
|
||
),
|
||
inside: $,
|
||
alias: 'class-name',
|
||
},
|
||
'constructor-invocation': {
|
||
pattern: s('(\\bnew\\s+)<<0>>(?=\\s*[[({])', [x]),
|
||
lookbehind: !0,
|
||
inside: $,
|
||
alias: 'class-name',
|
||
},
|
||
'generic-method': {
|
||
pattern: s('<<0>>\\s*<<1>>(?=\\s*\\()', [h, g]),
|
||
inside: {
|
||
function: s('^<<0>>', [h]),
|
||
generic: { pattern: RegExp(g), alias: 'class-name', inside: $ },
|
||
},
|
||
},
|
||
'type-list': {
|
||
pattern: s(
|
||
'\\b((?:<<0>>\\s+<<1>>|record\\s+<<1>>\\s*<<5>>|where\\s+<<2>>)\\s*:\\s*)(?:<<3>>|<<4>>|<<1>>\\s*<<5>>|<<6>>)(?:\\s*,\\s*(?:<<3>>|<<4>>|<<6>>))*(?=\\s*(?:where|[{;]|=>|$))',
|
||
[d, f, h, x, p.source, b, '\\bnew\\s*\\(\\s*\\)']
|
||
),
|
||
lookbehind: !0,
|
||
inside: {
|
||
'record-arguments': {
|
||
pattern: s('(^(?!new\\s*\\()<<0>>\\s*)<<1>>', [f, b]),
|
||
lookbehind: !0,
|
||
greedy: !0,
|
||
inside: e.languages.csharp,
|
||
},
|
||
keyword: p,
|
||
'class-name': { pattern: RegExp(x), greedy: !0, inside: $ },
|
||
punctuation: /[,()]/,
|
||
},
|
||
},
|
||
preprocessor: {
|
||
pattern: /(^[\t ]*)#.*/m,
|
||
lookbehind: !0,
|
||
alias: 'property',
|
||
inside: {
|
||
directive: {
|
||
pattern:
|
||
/(#)\b(?:define|elif|else|endif|endregion|error|if|line|nullable|pragma|region|undef|warning)\b/,
|
||
lookbehind: !0,
|
||
alias: 'keyword',
|
||
},
|
||
},
|
||
},
|
||
})
|
||
var E = B + '|' + _,
|
||
R = n('/(?![*/])|//[^\r\n]*[\r\n]|/\\*(?:[^*]|\\*(?!/))*\\*/|<<0>>', [E]),
|
||
z = a(n('[^"\'/()]|<<0>>|\\(<<self>>*\\)', [R]), 2),
|
||
S =
|
||
'\\b(?:assembly|event|field|method|module|param|property|return|type)\\b',
|
||
j = n('<<0>>(?:\\s*\\(<<1>>*\\))?', [m, z])
|
||
e.languages.insertBefore('csharp', 'class-name', {
|
||
attribute: {
|
||
pattern: s(
|
||
'((?:^|[^\\s\\w>)?])\\s*\\[\\s*)(?:<<0>>\\s*:\\s*)?<<1>>(?:\\s*,\\s*<<1>>)*(?=\\s*\\])',
|
||
[S, j]
|
||
),
|
||
lookbehind: !0,
|
||
greedy: !0,
|
||
inside: {
|
||
target: { pattern: s('^<<0>>(?=\\s*:)', [S]), alias: 'keyword' },
|
||
'attribute-arguments': {
|
||
pattern: s('\\(<<0>>*\\)', [z]),
|
||
inside: e.languages.csharp,
|
||
},
|
||
'class-name': { pattern: RegExp(m), inside: { punctuation: /\./ } },
|
||
punctuation: /[:,]/,
|
||
},
|
||
},
|
||
})
|
||
var A = ':[^}\r\n]+',
|
||
F = a(n('[^"\'/()]|<<0>>|\\(<<self>>*\\)', [R]), 2),
|
||
P = n('\\{(?!\\{)(?:(?![}:])<<0>>)*<<1>>?\\}', [F, A]),
|
||
U = a(
|
||
n('[^"\'/()]|/(?!\\*)|/\\*(?:[^*]|\\*(?!/))*\\*/|<<0>>|\\(<<self>>*\\)', [
|
||
E,
|
||
]),
|
||
2
|
||
),
|
||
Z = n('\\{(?!\\{)(?:(?![}:])<<0>>)*<<1>>?\\}', [U, A])
|
||
function q(n, a) {
|
||
return {
|
||
interpolation: {
|
||
pattern: s('((?:^|[^{])(?:\\{\\{)*)<<0>>', [n]),
|
||
lookbehind: !0,
|
||
inside: {
|
||
'format-string': {
|
||
pattern: s('(^\\{(?:(?![}:])<<0>>)*)<<1>>(?=\\}$)', [a, A]),
|
||
lookbehind: !0,
|
||
inside: { punctuation: /^:/ },
|
||
},
|
||
punctuation: /^\{|\}$/,
|
||
expression: {
|
||
pattern: /[\s\S]+/,
|
||
alias: 'language-csharp',
|
||
inside: e.languages.csharp,
|
||
},
|
||
},
|
||
},
|
||
string: /[\s\S]+/,
|
||
}
|
||
}
|
||
e.languages.insertBefore('csharp', 'string', {
|
||
'interpolation-string': [
|
||
{
|
||
pattern: s(
|
||
'(^|[^\\\\])(?:\\$@|@\\$)"(?:""|\\\\[^]|\\{\\{|<<0>>|[^\\\\{"])*"',
|
||
[P]
|
||
),
|
||
lookbehind: !0,
|
||
greedy: !0,
|
||
inside: q(P, F),
|
||
},
|
||
{
|
||
pattern: s('(^|[^@\\\\])\\$"(?:\\\\.|\\{\\{|<<0>>|[^\\\\"{])*"', [Z]),
|
||
lookbehind: !0,
|
||
greedy: !0,
|
||
inside: q(Z, U),
|
||
},
|
||
],
|
||
char: { pattern: RegExp(_), greedy: !0 },
|
||
}),
|
||
(e.languages.dotnet = e.languages.cs = e.languages.csharp)
|
||
})(Prism)
|
||
Prism.languages.git = {
|
||
comment: /^#.*/m,
|
||
deleted: /^[-–].*/m,
|
||
inserted: /^\+.*/m,
|
||
string: /("|')(?:\\.|(?!\1)[^\\\r\n])*\1/,
|
||
command: { pattern: /^.*\$ git .*$/m, inside: { parameter: /\s--?\w+/ } },
|
||
coord: /^@@.*@@$/m,
|
||
'commit-sha1': /^commit \w{40}$/m,
|
||
}
|
||
;(Prism.languages.json = {
|
||
property: {
|
||
pattern: /(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,
|
||
lookbehind: !0,
|
||
greedy: !0,
|
||
},
|
||
string: {
|
||
pattern: /(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,
|
||
lookbehind: !0,
|
||
greedy: !0,
|
||
},
|
||
comment: { pattern: /\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/, greedy: !0 },
|
||
number: /-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,
|
||
punctuation: /[{}[\],]/,
|
||
operator: /:/,
|
||
boolean: /\b(?:false|true)\b/,
|
||
null: { pattern: /\bnull\b/, alias: 'keyword' },
|
||
}),
|
||
(Prism.languages.webmanifest = Prism.languages.json)
|
||
Prism.languages.lua = {
|
||
comment: /^#!.+|--(?:\[(=*)\[[\s\S]*?\]\1\]|.*)/m,
|
||
string: {
|
||
pattern:
|
||
/(["'])(?:(?!\1)[^\\\r\n]|\\z(?:\r\n|\s)|\\(?:\r\n|[^z]))*\1|\[(=*)\[[\s\S]*?\]\2\]/,
|
||
greedy: !0,
|
||
},
|
||
number:
|
||
/\b0x[a-f\d]+(?:\.[a-f\d]*)?(?:p[+-]?\d+)?\b|\b\d+(?:\.\B|(?:\.\d*)?(?:e[+-]?\d+)?\b)|\B\.\d+(?:e[+-]?\d+)?\b/i,
|
||
keyword:
|
||
/\b(?:and|break|do|else|elseif|end|false|for|function|goto|if|in|local|nil|not|or|repeat|return|then|true|until|while)\b/,
|
||
function: /(?!\d)\w+(?=\s*(?:[({]))/,
|
||
operator: [
|
||
/[-+*%^&|#]|\/\/?|<[<=]?|>[>=]?|[=~]=?/,
|
||
{ pattern: /(^|[^.])\.\.(?!\.)/, lookbehind: !0 },
|
||
],
|
||
punctuation: /[\[\](){},;]|\.+|:+/,
|
||
}
|
||
!(function (n) {
|
||
function e(n) {
|
||
return (
|
||
(n = n.replace(/<inner>/g, function () {
|
||
return '(?:\\\\.|[^\\\\\n\r]|(?:\n|\r\n?)(?![\r\n]))'
|
||
})),
|
||
RegExp('((?:^|[^\\\\])(?:\\\\{2})*)(?:' + n + ')')
|
||
)
|
||
}
|
||
var t = '(?:\\\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\\\|\r\n`])+',
|
||
a = '\\|?__(?:\\|__)+\\|?(?:(?:\n|\r\n?)|(?![^]))'.replace(
|
||
/__/g,
|
||
function () {
|
||
return t
|
||
}
|
||
),
|
||
i = '\\|?[ \t]*:?-{3,}:?[ \t]*(?:\\|[ \t]*:?-{3,}:?[ \t]*)+\\|?(?:\n|\r\n?)'
|
||
;(n.languages.markdown = n.languages.extend('markup', {})),
|
||
n.languages.insertBefore('markdown', 'prolog', {
|
||
'front-matter-block': {
|
||
pattern: /(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,
|
||
lookbehind: !0,
|
||
greedy: !0,
|
||
inside: {
|
||
punctuation: /^---|---$/,
|
||
'front-matter': {
|
||
pattern: /\S+(?:\s+\S+)*/,
|
||
alias: ['yaml', 'language-yaml'],
|
||
inside: n.languages.yaml,
|
||
},
|
||
},
|
||
},
|
||
blockquote: { pattern: /^>(?:[\t ]*>)*/m, alias: 'punctuation' },
|
||
table: {
|
||
pattern: RegExp('^' + a + i + '(?:' + a + ')*', 'm'),
|
||
inside: {
|
||
'table-data-rows': {
|
||
pattern: RegExp('^(' + a + i + ')(?:' + a + ')*$'),
|
||
lookbehind: !0,
|
||
inside: {
|
||
'table-data': {
|
||
pattern: RegExp(t),
|
||
inside: n.languages.markdown,
|
||
},
|
||
punctuation: /\|/,
|
||
},
|
||
},
|
||
'table-line': {
|
||
pattern: RegExp('^(' + a + ')' + i + '$'),
|
||
lookbehind: !0,
|
||
inside: { punctuation: /\||:?-{3,}:?/ },
|
||
},
|
||
'table-header-row': {
|
||
pattern: RegExp('^' + a + '$'),
|
||
inside: {
|
||
'table-header': {
|
||
pattern: RegExp(t),
|
||
alias: 'important',
|
||
inside: n.languages.markdown,
|
||
},
|
||
punctuation: /\|/,
|
||
},
|
||
},
|
||
},
|
||
},
|
||
code: [
|
||
{
|
||
pattern:
|
||
/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,
|
||
lookbehind: !0,
|
||
alias: 'keyword',
|
||
},
|
||
{
|
||
pattern: /^```[\s\S]*?^```$/m,
|
||
greedy: !0,
|
||
inside: {
|
||
'code-block': {
|
||
pattern: /^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,
|
||
lookbehind: !0,
|
||
},
|
||
'code-language': { pattern: /^(```).+/, lookbehind: !0 },
|
||
punctuation: /```/,
|
||
},
|
||
},
|
||
],
|
||
title: [
|
||
{
|
||
pattern: /\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,
|
||
alias: 'important',
|
||
inside: { punctuation: /==+$|--+$/ },
|
||
},
|
||
{
|
||
pattern: /(^\s*)#.+/m,
|
||
lookbehind: !0,
|
||
alias: 'important',
|
||
inside: { punctuation: /^#+|#+$/ },
|
||
},
|
||
],
|
||
hr: {
|
||
pattern: /(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,
|
||
lookbehind: !0,
|
||
alias: 'punctuation',
|
||
},
|
||
list: {
|
||
pattern: /(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,
|
||
lookbehind: !0,
|
||
alias: 'punctuation',
|
||
},
|
||
'url-reference': {
|
||
pattern:
|
||
/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,
|
||
inside: {
|
||
variable: { pattern: /^(!?\[)[^\]]+/, lookbehind: !0 },
|
||
string:
|
||
/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,
|
||
punctuation: /^[\[\]!:]|[<>]/,
|
||
},
|
||
alias: 'url',
|
||
},
|
||
bold: {
|
||
pattern: e(
|
||
'\\b__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__\\b|\\*\\*(?:(?!\\*)<inner>|\\*(?:(?!\\*)<inner>)+\\*)+\\*\\*'
|
||
),
|
||
lookbehind: !0,
|
||
greedy: !0,
|
||
inside: {
|
||
content: {
|
||
pattern: /(^..)[\s\S]+(?=..$)/,
|
||
lookbehind: !0,
|
||
inside: {},
|
||
},
|
||
punctuation: /\*\*|__/,
|
||
},
|
||
},
|
||
italic: {
|
||
pattern: e(
|
||
'\\b_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_\\b|\\*(?:(?!\\*)<inner>|\\*\\*(?:(?!\\*)<inner>)+\\*\\*)+\\*'
|
||
),
|
||
lookbehind: !0,
|
||
greedy: !0,
|
||
inside: {
|
||
content: { pattern: /(^.)[\s\S]+(?=.$)/, lookbehind: !0, inside: {} },
|
||
punctuation: /[*_]/,
|
||
},
|
||
},
|
||
strike: {
|
||
pattern: e('(~~?)(?:(?!~)<inner>)+\\2'),
|
||
lookbehind: !0,
|
||
greedy: !0,
|
||
inside: {
|
||
content: {
|
||
pattern: /(^~~?)[\s\S]+(?=\1$)/,
|
||
lookbehind: !0,
|
||
inside: {},
|
||
},
|
||
punctuation: /~~?/,
|
||
},
|
||
},
|
||
'code-snippet': {
|
||
pattern:
|
||
/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,
|
||
lookbehind: !0,
|
||
greedy: !0,
|
||
alias: ['code', 'keyword'],
|
||
},
|
||
url: {
|
||
pattern: e(
|
||
'!?\\[(?:(?!\\])<inner>)+\\](?:\\([^\\s)]+(?:[\t ]+"(?:\\\\.|[^"\\\\])*")?\\)|[ \t]?\\[(?:(?!\\])<inner>)+\\])'
|
||
),
|
||
lookbehind: !0,
|
||
greedy: !0,
|
||
inside: {
|
||
operator: /^!/,
|
||
content: { pattern: /(^\[)[^\]]+(?=\])/, lookbehind: !0, inside: {} },
|
||
variable: { pattern: /(^\][ \t]?\[)[^\]]+(?=\]$)/, lookbehind: !0 },
|
||
url: { pattern: /(^\]\()[^\s)]+/, lookbehind: !0 },
|
||
string: {
|
||
pattern: /(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,
|
||
lookbehind: !0,
|
||
},
|
||
},
|
||
},
|
||
}),
|
||
['url', 'bold', 'italic', 'strike'].forEach(function (e) {
|
||
;['url', 'bold', 'italic', 'strike', 'code-snippet'].forEach(
|
||
function (t) {
|
||
e !== t &&
|
||
(n.languages.markdown[e].inside.content.inside[t] =
|
||
n.languages.markdown[t])
|
||
}
|
||
)
|
||
}),
|
||
n.hooks.add('after-tokenize', function (n) {
|
||
;('markdown' !== n.language && 'md' !== n.language) ||
|
||
(function n(e) {
|
||
if (e && 'string' != typeof e)
|
||
for (var t = 0, a = e.length; t < a; t++) {
|
||
var i = e[t]
|
||
if ('code' === i.type) {
|
||
var r = i.content[1],
|
||
o = i.content[3]
|
||
if (
|
||
r &&
|
||
o &&
|
||
'code-language' === r.type &&
|
||
'code-block' === o.type &&
|
||
'string' == typeof r.content
|
||
) {
|
||
var l = r.content
|
||
.replace(/\b#/g, 'sharp')
|
||
.replace(/\b\+\+/g, 'pp'),
|
||
s =
|
||
'language-' +
|
||
(l = (/[a-z][\w-]*/i.exec(l) || [''])[0].toLowerCase())
|
||
o.alias
|
||
? 'string' == typeof o.alias
|
||
? (o.alias = [o.alias, s])
|
||
: o.alias.push(s)
|
||
: (o.alias = [s])
|
||
}
|
||
} else n(i.content)
|
||
}
|
||
})(n.tokens)
|
||
}),
|
||
n.hooks.add('wrap', function (e) {
|
||
if ('code-block' === e.type) {
|
||
for (var t = '', a = 0, i = e.classes.length; a < i; a++) {
|
||
var s = e.classes[a],
|
||
d = /language-(.+)/.exec(s)
|
||
if (d) {
|
||
t = d[1]
|
||
break
|
||
}
|
||
}
|
||
var p = n.languages[t]
|
||
if (p)
|
||
e.content = n.highlight(
|
||
e.content
|
||
.replace(r, '')
|
||
.replace(/&(\w{1,8}|#x?[\da-f]{1,8});/gi, function (n, e) {
|
||
var t
|
||
return '#' === (e = e.toLowerCase())[0]
|
||
? ((t =
|
||
'x' === e[1]
|
||
? parseInt(e.slice(2), 16)
|
||
: Number(e.slice(1))),
|
||
l(t))
|
||
: o[e] || n
|
||
}),
|
||
p,
|
||
t
|
||
)
|
||
else if (t && 'none' !== t && n.plugins.autoloader) {
|
||
var u =
|
||
'md-' +
|
||
new Date().valueOf() +
|
||
'-' +
|
||
Math.floor(1e16 * Math.random())
|
||
;(e.attributes.id = u),
|
||
n.plugins.autoloader.loadLanguages(t, function () {
|
||
var e = document.getElementById(u)
|
||
e && (e.innerHTML = n.highlight(e.textContent, n.languages[t], t))
|
||
})
|
||
}
|
||
}
|
||
})
|
||
var r = RegExp(n.languages.markup.tag.pattern.source, 'gi'),
|
||
o = { amp: '&', lt: '<', gt: '>', quot: '"' },
|
||
l = String.fromCodePoint || String.fromCharCode
|
||
n.languages.md = n.languages.markdown
|
||
})(Prism)
|
||
!(function (e) {
|
||
function n(e, n) {
|
||
return '___' + e.toUpperCase() + n + '___'
|
||
}
|
||
Object.defineProperties((e.languages['markup-templating'] = {}), {
|
||
buildPlaceholders: {
|
||
value: function (t, a, r, o) {
|
||
if (t.language === a) {
|
||
var c = (t.tokenStack = [])
|
||
;(t.code = t.code.replace(r, function (e) {
|
||
if ('function' == typeof o && !o(e)) return e
|
||
for (var r, i = c.length; -1 !== t.code.indexOf((r = n(a, i))); )
|
||
++i
|
||
return (c[i] = e), r
|
||
})),
|
||
(t.grammar = e.languages.markup)
|
||
}
|
||
},
|
||
},
|
||
tokenizePlaceholders: {
|
||
value: function (t, a) {
|
||
if (t.language === a && t.tokenStack) {
|
||
t.grammar = e.languages[a]
|
||
var r = 0,
|
||
o = Object.keys(t.tokenStack)
|
||
!(function c(i) {
|
||
for (var u = 0; u < i.length && !(r >= o.length); u++) {
|
||
var g = i[u]
|
||
if (
|
||
'string' == typeof g ||
|
||
(g.content && 'string' == typeof g.content)
|
||
) {
|
||
var l = o[r],
|
||
s = t.tokenStack[l],
|
||
f = 'string' == typeof g ? g : g.content,
|
||
p = n(a, l),
|
||
k = f.indexOf(p)
|
||
if (k > -1) {
|
||
++r
|
||
var m = f.substring(0, k),
|
||
d = new e.Token(
|
||
a,
|
||
e.tokenize(s, t.grammar),
|
||
'language-' + a,
|
||
s
|
||
),
|
||
h = f.substring(k + p.length),
|
||
v = []
|
||
m && v.push.apply(v, c([m])),
|
||
v.push(d),
|
||
h && v.push.apply(v, c([h])),
|
||
'string' == typeof g
|
||
? i.splice.apply(i, [u, 1].concat(v))
|
||
: (g.content = v)
|
||
}
|
||
} else g.content && c(g.content)
|
||
}
|
||
return i
|
||
})(t.tokens)
|
||
}
|
||
},
|
||
},
|
||
})
|
||
})(Prism)
|
||
!(function (e) {
|
||
var a = /\/\*[\s\S]*?\*\/|\/\/.*|#(?!\[).*/,
|
||
t = [
|
||
{ pattern: /\b(?:false|true)\b/i, alias: 'boolean' },
|
||
{ pattern: /(::\s*)\b[a-z_]\w*\b(?!\s*\()/i, greedy: !0, lookbehind: !0 },
|
||
{
|
||
pattern: /(\b(?:case|const)\s+)\b[a-z_]\w*(?=\s*[;=])/i,
|
||
greedy: !0,
|
||
lookbehind: !0,
|
||
},
|
||
/\b(?:null)\b/i,
|
||
/\b[A-Z_][A-Z0-9_]*\b(?!\s*\()/,
|
||
],
|
||
i =
|
||
/\b0b[01]+(?:_[01]+)*\b|\b0o[0-7]+(?:_[0-7]+)*\b|\b0x[\da-f]+(?:_[\da-f]+)*\b|(?:\b\d+(?:_\d+)*\.?(?:\d+(?:_\d+)*)?|\B\.\d+)(?:e[+-]?\d+)?/i,
|
||
n =
|
||
/<?=>|\?\?=?|\.{3}|\??->|[!=]=?=?|::|\*\*=?|--|\+\+|&&|\|\||<<|>>|[?~]|[/^|%*&<>.+-]=?/,
|
||
s = /[{}\[\](),:;]/
|
||
e.languages.php = {
|
||
delimiter: { pattern: /\?>$|^<\?(?:php(?=\s)|=)?/i, alias: 'important' },
|
||
comment: a,
|
||
variable: /\$+(?:\w+\b|(?=\{))/,
|
||
package: {
|
||
pattern:
|
||
/(namespace\s+|use\s+(?:function\s+)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,
|
||
lookbehind: !0,
|
||
inside: { punctuation: /\\/ },
|
||
},
|
||
'class-name-definition': {
|
||
pattern: /(\b(?:class|enum|interface|trait)\s+)\b[a-z_]\w*(?!\\)\b/i,
|
||
lookbehind: !0,
|
||
alias: 'class-name',
|
||
},
|
||
'function-definition': {
|
||
pattern: /(\bfunction\s+)[a-z_]\w*(?=\s*\()/i,
|
||
lookbehind: !0,
|
||
alias: 'function',
|
||
},
|
||
keyword: [
|
||
{
|
||
pattern:
|
||
/(\(\s*)\b(?:array|bool|boolean|float|int|integer|object|string)\b(?=\s*\))/i,
|
||
alias: 'type-casting',
|
||
greedy: !0,
|
||
lookbehind: !0,
|
||
},
|
||
{
|
||
pattern:
|
||
/([(,?]\s*)\b(?:array(?!\s*\()|bool|callable|(?:false|null)(?=\s*\|)|float|int|iterable|mixed|object|self|static|string)\b(?=\s*\$)/i,
|
||
alias: 'type-hint',
|
||
greedy: !0,
|
||
lookbehind: !0,
|
||
},
|
||
{
|
||
pattern:
|
||
/(\)\s*:\s*(?:\?\s*)?)\b(?:array(?!\s*\()|bool|callable|(?:false|null)(?=\s*\|)|float|int|iterable|mixed|never|object|self|static|string|void)\b/i,
|
||
alias: 'return-type',
|
||
greedy: !0,
|
||
lookbehind: !0,
|
||
},
|
||
{
|
||
pattern:
|
||
/\b(?:array(?!\s*\()|bool|float|int|iterable|mixed|object|string|void)\b/i,
|
||
alias: 'type-declaration',
|
||
greedy: !0,
|
||
},
|
||
{
|
||
pattern: /(\|\s*)(?:false|null)\b|\b(?:false|null)(?=\s*\|)/i,
|
||
alias: 'type-declaration',
|
||
greedy: !0,
|
||
lookbehind: !0,
|
||
},
|
||
{
|
||
pattern: /\b(?:parent|self|static)(?=\s*::)/i,
|
||
alias: 'static-context',
|
||
greedy: !0,
|
||
},
|
||
{ pattern: /(\byield\s+)from\b/i, lookbehind: !0 },
|
||
/\bclass\b/i,
|
||
{
|
||
pattern:
|
||
/((?:^|[^\s>:]|(?:^|[^-])>|(?:^|[^:]):)\s*)\b(?:abstract|and|array|as|break|callable|case|catch|clone|const|continue|declare|default|die|do|echo|else|elseif|empty|enddeclare|endfor|endforeach|endif|endswitch|endwhile|enum|eval|exit|extends|final|finally|fn|for|foreach|function|global|goto|if|implements|include|include_once|instanceof|insteadof|interface|isset|list|match|namespace|never|new|or|parent|print|private|protected|public|readonly|require|require_once|return|self|static|switch|throw|trait|try|unset|use|var|while|xor|yield|__halt_compiler)\b/i,
|
||
lookbehind: !0,
|
||
},
|
||
],
|
||
'argument-name': {
|
||
pattern: /([(,]\s*)\b[a-z_]\w*(?=\s*:(?!:))/i,
|
||
lookbehind: !0,
|
||
},
|
||
'class-name': [
|
||
{
|
||
pattern:
|
||
/(\b(?:extends|implements|instanceof|new(?!\s+self|\s+static))\s+|\bcatch\s*\()\b[a-z_]\w*(?!\\)\b/i,
|
||
greedy: !0,
|
||
lookbehind: !0,
|
||
},
|
||
{ pattern: /(\|\s*)\b[a-z_]\w*(?!\\)\b/i, greedy: !0, lookbehind: !0 },
|
||
{ pattern: /\b[a-z_]\w*(?!\\)\b(?=\s*\|)/i, greedy: !0 },
|
||
{
|
||
pattern: /(\|\s*)(?:\\?\b[a-z_]\w*)+\b/i,
|
||
alias: 'class-name-fully-qualified',
|
||
greedy: !0,
|
||
lookbehind: !0,
|
||
inside: { punctuation: /\\/ },
|
||
},
|
||
{
|
||
pattern: /(?:\\?\b[a-z_]\w*)+\b(?=\s*\|)/i,
|
||
alias: 'class-name-fully-qualified',
|
||
greedy: !0,
|
||
inside: { punctuation: /\\/ },
|
||
},
|
||
{
|
||
pattern:
|
||
/(\b(?:extends|implements|instanceof|new(?!\s+self\b|\s+static\b))\s+|\bcatch\s*\()(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,
|
||
alias: 'class-name-fully-qualified',
|
||
greedy: !0,
|
||
lookbehind: !0,
|
||
inside: { punctuation: /\\/ },
|
||
},
|
||
{
|
||
pattern: /\b[a-z_]\w*(?=\s*\$)/i,
|
||
alias: 'type-declaration',
|
||
greedy: !0,
|
||
},
|
||
{
|
||
pattern: /(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,
|
||
alias: ['class-name-fully-qualified', 'type-declaration'],
|
||
greedy: !0,
|
||
inside: { punctuation: /\\/ },
|
||
},
|
||
{ pattern: /\b[a-z_]\w*(?=\s*::)/i, alias: 'static-context', greedy: !0 },
|
||
{
|
||
pattern: /(?:\\?\b[a-z_]\w*)+(?=\s*::)/i,
|
||
alias: ['class-name-fully-qualified', 'static-context'],
|
||
greedy: !0,
|
||
inside: { punctuation: /\\/ },
|
||
},
|
||
{
|
||
pattern: /([(,?]\s*)[a-z_]\w*(?=\s*\$)/i,
|
||
alias: 'type-hint',
|
||
greedy: !0,
|
||
lookbehind: !0,
|
||
},
|
||
{
|
||
pattern: /([(,?]\s*)(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,
|
||
alias: ['class-name-fully-qualified', 'type-hint'],
|
||
greedy: !0,
|
||
lookbehind: !0,
|
||
inside: { punctuation: /\\/ },
|
||
},
|
||
{
|
||
pattern: /(\)\s*:\s*(?:\?\s*)?)\b[a-z_]\w*(?!\\)\b/i,
|
||
alias: 'return-type',
|
||
greedy: !0,
|
||
lookbehind: !0,
|
||
},
|
||
{
|
||
pattern: /(\)\s*:\s*(?:\?\s*)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,
|
||
alias: ['class-name-fully-qualified', 'return-type'],
|
||
greedy: !0,
|
||
lookbehind: !0,
|
||
inside: { punctuation: /\\/ },
|
||
},
|
||
],
|
||
constant: t,
|
||
function: {
|
||
pattern: /(^|[^\\\w])\\?[a-z_](?:[\w\\]*\w)?(?=\s*\()/i,
|
||
lookbehind: !0,
|
||
inside: { punctuation: /\\/ },
|
||
},
|
||
property: { pattern: /(->\s*)\w+/, lookbehind: !0 },
|
||
number: i,
|
||
operator: n,
|
||
punctuation: s,
|
||
}
|
||
var l = {
|
||
pattern:
|
||
/\{\$(?:\{(?:\{[^{}]+\}|[^{}]+)\}|[^{}])+\}|(^|[^\\{])\$+(?:\w+(?:\[[^\r\n\[\]]+\]|->\w+)?)/,
|
||
lookbehind: !0,
|
||
inside: e.languages.php,
|
||
},
|
||
r = [
|
||
{
|
||
pattern: /<<<'([^']+)'[\r\n](?:.*[\r\n])*?\1;/,
|
||
alias: 'nowdoc-string',
|
||
greedy: !0,
|
||
inside: {
|
||
delimiter: {
|
||
pattern: /^<<<'[^']+'|[a-z_]\w*;$/i,
|
||
alias: 'symbol',
|
||
inside: { punctuation: /^<<<'?|[';]$/ },
|
||
},
|
||
},
|
||
},
|
||
{
|
||
pattern:
|
||
/<<<(?:"([^"]+)"[\r\n](?:.*[\r\n])*?\1;|([a-z_]\w*)[\r\n](?:.*[\r\n])*?\2;)/i,
|
||
alias: 'heredoc-string',
|
||
greedy: !0,
|
||
inside: {
|
||
delimiter: {
|
||
pattern: /^<<<(?:"[^"]+"|[a-z_]\w*)|[a-z_]\w*;$/i,
|
||
alias: 'symbol',
|
||
inside: { punctuation: /^<<<"?|[";]$/ },
|
||
},
|
||
interpolation: l,
|
||
},
|
||
},
|
||
{
|
||
pattern: /`(?:\\[\s\S]|[^\\`])*`/,
|
||
alias: 'backtick-quoted-string',
|
||
greedy: !0,
|
||
},
|
||
{
|
||
pattern: /'(?:\\[\s\S]|[^\\'])*'/,
|
||
alias: 'single-quoted-string',
|
||
greedy: !0,
|
||
},
|
||
{
|
||
pattern: /"(?:\\[\s\S]|[^\\"])*"/,
|
||
alias: 'double-quoted-string',
|
||
greedy: !0,
|
||
inside: { interpolation: l },
|
||
},
|
||
]
|
||
e.languages.insertBefore('php', 'variable', {
|
||
string: r,
|
||
attribute: {
|
||
pattern:
|
||
/#\[(?:[^"'\/#]|\/(?![*/])|\/\/.*$|#(?!\[).*$|\/\*(?:[^*]|\*(?!\/))*\*\/|"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*')+\](?=\s*[a-z$#])/im,
|
||
greedy: !0,
|
||
inside: {
|
||
'attribute-content': {
|
||
pattern: /^(#\[)[\s\S]+(?=\]$)/,
|
||
lookbehind: !0,
|
||
inside: {
|
||
comment: a,
|
||
string: r,
|
||
'attribute-class-name': [
|
||
{
|
||
pattern: /([^:]|^)\b[a-z_]\w*(?!\\)\b/i,
|
||
alias: 'class-name',
|
||
greedy: !0,
|
||
lookbehind: !0,
|
||
},
|
||
{
|
||
pattern: /([^:]|^)(?:\\?\b[a-z_]\w*)+/i,
|
||
alias: ['class-name', 'class-name-fully-qualified'],
|
||
greedy: !0,
|
||
lookbehind: !0,
|
||
inside: { punctuation: /\\/ },
|
||
},
|
||
],
|
||
constant: t,
|
||
number: i,
|
||
operator: n,
|
||
punctuation: s,
|
||
},
|
||
},
|
||
delimiter: { pattern: /^#\[|\]$/, alias: 'punctuation' },
|
||
},
|
||
},
|
||
}),
|
||
e.hooks.add('before-tokenize', function (a) {
|
||
;/<\?/.test(a.code) &&
|
||
e.languages['markup-templating'].buildPlaceholders(
|
||
a,
|
||
'php',
|
||
/<\?(?:[^"'/#]|\/(?![*/])|("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|(?:\/\/|#(?!\[))(?:[^?\n\r]|\?(?!>))*(?=$|\?>|[\r\n])|#\[|\/\*(?:[^*]|\*(?!\/))*(?:\*\/|$))*?(?:\?>|$)/g
|
||
)
|
||
}),
|
||
e.hooks.add('after-tokenize', function (a) {
|
||
e.languages['markup-templating'].tokenizePlaceholders(a, 'php')
|
||
})
|
||
})(Prism)
|
||
;(Prism.languages.python = {
|
||
comment: { pattern: /(^|[^\\])#.*/, lookbehind: !0, greedy: !0 },
|
||
'string-interpolation': {
|
||
pattern:
|
||
/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,
|
||
greedy: !0,
|
||
inside: {
|
||
interpolation: {
|
||
pattern:
|
||
/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,
|
||
lookbehind: !0,
|
||
inside: {
|
||
'format-spec': { pattern: /(:)[^:(){}]+(?=\}$)/, lookbehind: !0 },
|
||
'conversion-option': {
|
||
pattern: //,
|
||
alias: 'punctuation',
|
||
},
|
||
rest: null,
|
||
},
|
||
},
|
||
string: /[\s\S]+/,
|
||
},
|
||
},
|
||
'triple-quoted-string': {
|
||
pattern: /(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,
|
||
greedy: !0,
|
||
alias: 'string',
|
||
},
|
||
string: {
|
||
pattern: /(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,
|
||
greedy: !0,
|
||
},
|
||
function: {
|
||
pattern: /((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,
|
||
lookbehind: !0,
|
||
},
|
||
'class-name': { pattern: /(\bclass\s+)\w+/i, lookbehind: !0 },
|
||
decorator: {
|
||
pattern: /(^[\t ]*)@\w+(?:\.\w+)*/m,
|
||
lookbehind: !0,
|
||
alias: ['annotation', 'punctuation'],
|
||
inside: { punctuation: /\./ },
|
||
},
|
||
keyword:
|
||
/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,
|
||
builtin:
|
||
/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,
|
||
boolean: /\b(?:False|None|True)\b/,
|
||
number:
|
||
/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,
|
||
operator: /[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,
|
||
punctuation: /[{}[\];(),.:]/,
|
||
}),
|
||
(Prism.languages.python[
|
||
'string-interpolation'
|
||
].inside.interpolation.inside.rest = Prism.languages.python),
|
||
(Prism.languages.py = Prism.languages.python)
|
||
!(function (e) {
|
||
;(e.languages.ruby = e.languages.extend('clike', {
|
||
comment: { pattern: /#.*|^=begin\s[\s\S]*?^=end/m, greedy: !0 },
|
||
'class-name': {
|
||
pattern:
|
||
/(\b(?:class|module)\s+|\bcatch\s+\()[\w.\\]+|\b[A-Z_]\w*(?=\s*\.\s*new\b)/,
|
||
lookbehind: !0,
|
||
inside: { punctuation: /[.\\]/ },
|
||
},
|
||
keyword:
|
||
/\b(?:BEGIN|END|alias|and|begin|break|case|class|def|define_method|defined|do|each|else|elsif|end|ensure|extend|for|if|in|include|module|new|next|nil|not|or|prepend|private|protected|public|raise|redo|require|rescue|retry|return|self|super|then|throw|undef|unless|until|when|while|yield)\b/,
|
||
operator:
|
||
/\.{2,3}|&\.|===|<?=>|[!=]?~|(?:&&|\|\||<<|>>|\*\*|[+\-*/%<>!^&|=])=?|[?:]/,
|
||
punctuation: /[(){}[\].,;]/,
|
||
})),
|
||
e.languages.insertBefore('ruby', 'operator', {
|
||
'double-colon': { pattern: /::/, alias: 'punctuation' },
|
||
})
|
||
var n = {
|
||
pattern: /((?:^|[^\\])(?:\\{2})*)#\{(?:[^{}]|\{[^{}]*\})*\}/,
|
||
lookbehind: !0,
|
||
inside: {
|
||
content: {
|
||
pattern: /^(#\{)[\s\S]+(?=\}$)/,
|
||
lookbehind: !0,
|
||
inside: e.languages.ruby,
|
||
},
|
||
delimiter: { pattern: /^#\{|\}$/, alias: 'punctuation' },
|
||
},
|
||
}
|
||
delete e.languages.ruby.function
|
||
var t =
|
||
'(?:' +
|
||
[
|
||
'([^a-zA-Z0-9\\s{(\\[<=])(?:(?!\\1)[^\\\\]|\\\\[^])*\\1',
|
||
'\\((?:[^()\\\\]|\\\\[^]|\\((?:[^()\\\\]|\\\\[^])*\\))*\\)',
|
||
'\\{(?:[^{}\\\\]|\\\\[^]|\\{(?:[^{}\\\\]|\\\\[^])*\\})*\\}',
|
||
'\\[(?:[^\\[\\]\\\\]|\\\\[^]|\\[(?:[^\\[\\]\\\\]|\\\\[^])*\\])*\\]',
|
||
'<(?:[^<>\\\\]|\\\\[^]|<(?:[^<>\\\\]|\\\\[^])*>)*>',
|
||
].join('|') +
|
||
')',
|
||
i =
|
||
'(?:"(?:\\\\.|[^"\\\\\r\n])*"|(?:\\b[a-zA-Z_]\\w*|[^\\s\0-\\x7F]+)[?!]?|\\$.)'
|
||
e.languages.insertBefore('ruby', 'keyword', {
|
||
'regex-literal': [
|
||
{
|
||
pattern: RegExp('%r' + t + '[egimnosux]{0,6}'),
|
||
greedy: !0,
|
||
inside: { interpolation: n, regex: /[\s\S]+/ },
|
||
},
|
||
{
|
||
pattern:
|
||
/(^|[^/])\/(?!\/)(?:\[[^\r\n\]]+\]|\\.|[^[/\\\r\n])+\/[egimnosux]{0,6}(?=\s*(?:$|[\r\n,.;})#]))/,
|
||
lookbehind: !0,
|
||
greedy: !0,
|
||
inside: { interpolation: n, regex: /[\s\S]+/ },
|
||
},
|
||
],
|
||
variable: /[@$]+[a-zA-Z_]\w*(?:[?!]|\b)/,
|
||
symbol: [
|
||
{ pattern: RegExp('(^|[^:]):' + i), lookbehind: !0, greedy: !0 },
|
||
{
|
||
pattern: RegExp('([\r\n{(,][ \t]*)' + i + '(?=:(?!:))'),
|
||
lookbehind: !0,
|
||
greedy: !0,
|
||
},
|
||
],
|
||
'method-definition': {
|
||
pattern: /(\bdef\s+)\w+(?:\s*\.\s*\w+)?/,
|
||
lookbehind: !0,
|
||
inside: {
|
||
function: /\b\w+$/,
|
||
keyword: /^self\b/,
|
||
'class-name': /^\w+/,
|
||
punctuation: /\./,
|
||
},
|
||
},
|
||
}),
|
||
e.languages.insertBefore('ruby', 'string', {
|
||
'string-literal': [
|
||
{
|
||
pattern: RegExp('%[qQiIwWs]?' + t),
|
||
greedy: !0,
|
||
inside: { interpolation: n, string: /[\s\S]+/ },
|
||
},
|
||
{
|
||
pattern:
|
||
/("|')(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|(?!\1)[^\\#\r\n])*\1/,
|
||
greedy: !0,
|
||
inside: { interpolation: n, string: /[\s\S]+/ },
|
||
},
|
||
{
|
||
pattern: /<<[-~]?([a-z_]\w*)[\r\n](?:.*[\r\n])*?[\t ]*\1/i,
|
||
alias: 'heredoc-string',
|
||
greedy: !0,
|
||
inside: {
|
||
delimiter: {
|
||
pattern: /^<<[-~]?[a-z_]\w*|\b[a-z_]\w*$/i,
|
||
inside: { symbol: /\b\w+/, punctuation: /^<<[-~]?/ },
|
||
},
|
||
interpolation: n,
|
||
string: /[\s\S]+/,
|
||
},
|
||
},
|
||
{
|
||
pattern: /<<[-~]?'([a-z_]\w*)'[\r\n](?:.*[\r\n])*?[\t ]*\1/i,
|
||
alias: 'heredoc-string',
|
||
greedy: !0,
|
||
inside: {
|
||
delimiter: {
|
||
pattern: /^<<[-~]?'[a-z_]\w*'|\b[a-z_]\w*$/i,
|
||
inside: { symbol: /\b\w+/, punctuation: /^<<[-~]?'|'$/ },
|
||
},
|
||
string: /[\s\S]+/,
|
||
},
|
||
},
|
||
],
|
||
'command-literal': [
|
||
{
|
||
pattern: RegExp('%x' + t),
|
||
greedy: !0,
|
||
inside: {
|
||
interpolation: n,
|
||
command: { pattern: /[\s\S]+/, alias: 'string' },
|
||
},
|
||
},
|
||
{
|
||
pattern: /`(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|[^\\`#\r\n])*`/,
|
||
greedy: !0,
|
||
inside: {
|
||
interpolation: n,
|
||
command: { pattern: /[\s\S]+/, alias: 'string' },
|
||
},
|
||
},
|
||
],
|
||
}),
|
||
delete e.languages.ruby.string,
|
||
e.languages.insertBefore('ruby', 'number', {
|
||
builtin:
|
||
/\b(?:Array|Bignum|Binding|Class|Continuation|Dir|Exception|FalseClass|File|Fixnum|Float|Hash|IO|Integer|MatchData|Method|Module|NilClass|Numeric|Object|Proc|Range|Regexp|Stat|String|Struct|Symbol|TMS|Thread|ThreadGroup|Time|TrueClass)\b/,
|
||
constant: /\b[A-Z][A-Z0-9_]*(?:[?!]|\b)/,
|
||
}),
|
||
(e.languages.rb = e.languages.ruby)
|
||
})(Prism)
|
||
!(function (e) {
|
||
var n = /[*&][^\s[\]{},]+/,
|
||
r =
|
||
/!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/,
|
||
t =
|
||
'(?:' +
|
||
r.source +
|
||
'(?:[ \t]+' +
|
||
n.source +
|
||
')?|' +
|
||
n.source +
|
||
'(?:[ \t]+' +
|
||
r.source +
|
||
')?)',
|
||
a =
|
||
'(?:[^\\s\\x00-\\x08\\x0e-\\x1f!"#%&\'*,\\-:>?@[\\]`{|}\\x7f-\\x84\\x86-\\x9f\\ud800-\\udfff\\ufffe\\uffff]|[?:-]<PLAIN>)(?:[ \t]*(?:(?![#:])<PLAIN>|:<PLAIN>))*'.replace(
|
||
/<PLAIN>/g,
|
||
function () {
|
||
return '[^\\s\\x00-\\x08\\x0e-\\x1f,[\\]{}\\x7f-\\x84\\x86-\\x9f\\ud800-\\udfff\\ufffe\\uffff]'
|
||
}
|
||
),
|
||
d = '"(?:[^"\\\\\r\n]|\\\\.)*"|\'(?:[^\'\\\\\r\n]|\\\\.)*\''
|
||
function o(e, n) {
|
||
n = (n || '').replace(/m/g, '') + 'm'
|
||
var r =
|
||
'([:\\-,[{]\\s*(?:\\s<<prop>>[ \t]+)?)(?:<<value>>)(?=[ \t]*(?:$|,|\\]|\\}|(?:[\r\n]\\s*)?#))'
|
||
.replace(/<<prop>>/g, function () {
|
||
return t
|
||
})
|
||
.replace(/<<value>>/g, function () {
|
||
return e
|
||
})
|
||
return RegExp(r, n)
|
||
}
|
||
;(e.languages.yaml = {
|
||
scalar: {
|
||
pattern: RegExp(
|
||
'([\\-:]\\s*(?:\\s<<prop>>[ \t]+)?[|>])[ \t]*(?:((?:\r?\n|\r)[ \t]+)\\S[^\r\n]*(?:\\2[^\r\n]+)*)'.replace(
|
||
/<<prop>>/g,
|
||
function () {
|
||
return t
|
||
}
|
||
)
|
||
),
|
||
lookbehind: !0,
|
||
alias: 'string',
|
||
},
|
||
comment: /#.*/,
|
||
key: {
|
||
pattern: RegExp(
|
||
'((?:^|[:\\-,[{\r\n?])[ \t]*(?:<<prop>>[ \t]+)?)<<key>>(?=\\s*:\\s)'
|
||
.replace(/<<prop>>/g, function () {
|
||
return t
|
||
})
|
||
.replace(/<<key>>/g, function () {
|
||
return '(?:' + a + '|' + d + ')'
|
||
})
|
||
),
|
||
lookbehind: !0,
|
||
greedy: !0,
|
||
alias: 'atrule',
|
||
},
|
||
directive: { pattern: /(^[ \t]*)%.+/m, lookbehind: !0, alias: 'important' },
|
||
datetime: {
|
||
pattern: o(
|
||
'\\d{4}-\\d\\d?-\\d\\d?(?:[tT]|[ \t]+)\\d\\d?:\\d{2}:\\d{2}(?:\\.\\d*)?(?:[ \t]*(?:Z|[-+]\\d\\d?(?::\\d{2})?))?|\\d{4}-\\d{2}-\\d{2}|\\d\\d?:\\d{2}(?::\\d{2}(?:\\.\\d*)?)?'
|
||
),
|
||
lookbehind: !0,
|
||
alias: 'number',
|
||
},
|
||
boolean: {
|
||
pattern: o('false|true', 'i'),
|
||
lookbehind: !0,
|
||
alias: 'important',
|
||
},
|
||
null: { pattern: o('null|~', 'i'), lookbehind: !0, alias: 'important' },
|
||
string: { pattern: o(d), lookbehind: !0, greedy: !0 },
|
||
number: {
|
||
pattern: o(
|
||
'[+-]?(?:0x[\\da-f]+|0o[0-7]+|(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:e[+-]?\\d+)?|\\.inf|\\.nan)',
|
||
'i'
|
||
),
|
||
lookbehind: !0,
|
||
},
|
||
tag: r,
|
||
important: n,
|
||
punctuation: /---|[:[\]{}\-,|>?]|\.\.\./,
|
||
}),
|
||
(e.languages.yml = e.languages.yaml)
|
||
})(Prism)
|
||
!(function () {
|
||
if (
|
||
'undefined' != typeof Prism &&
|
||
'undefined' != typeof document &&
|
||
document.querySelector
|
||
) {
|
||
var e,
|
||
t = 'line-numbers',
|
||
i = 'linkable-line-numbers',
|
||
n = /\n(?!$)/g,
|
||
r = !0
|
||
Prism.plugins.lineHighlight = {
|
||
highlightLines: function (o, u, c) {
|
||
var h = (u =
|
||
'string' == typeof u ? u : o.getAttribute('data-line') || '')
|
||
.replace(/\s+/g, '')
|
||
.split(',')
|
||
.filter(Boolean),
|
||
d = +o.getAttribute('data-line-offset') || 0,
|
||
f = (
|
||
(function () {
|
||
if (void 0 === e) {
|
||
var t = document.createElement('div')
|
||
;(t.style.fontSize = '13px'),
|
||
(t.style.lineHeight = '1.5'),
|
||
(t.style.padding = '0'),
|
||
(t.style.border = '0'),
|
||
(t.innerHTML = ' <br /> '),
|
||
document.body.appendChild(t),
|
||
(e = 38 === t.offsetHeight),
|
||
document.body.removeChild(t)
|
||
}
|
||
return e
|
||
})()
|
||
? parseInt
|
||
: parseFloat
|
||
)(getComputedStyle(o).lineHeight),
|
||
p = Prism.util.isActive(o, t),
|
||
g = o.querySelector('code'),
|
||
m = p ? o : g || o,
|
||
v = [],
|
||
y = g.textContent.match(n),
|
||
b = y ? y.length + 1 : 1,
|
||
A =
|
||
g && m != g
|
||
? (function (e, t) {
|
||
var i = getComputedStyle(e),
|
||
n = getComputedStyle(t)
|
||
function r(e) {
|
||
return +e.substr(0, e.length - 2)
|
||
}
|
||
return (
|
||
t.offsetTop +
|
||
r(n.borderTopWidth) +
|
||
r(n.paddingTop) -
|
||
r(i.paddingTop)
|
||
)
|
||
})(o, g)
|
||
: 0
|
||
h.forEach(function (e) {
|
||
var t = e.split('-'),
|
||
i = +t[0],
|
||
n = +t[1] || i
|
||
if (!((n = Math.min(b + d, n)) < i)) {
|
||
var r =
|
||
o.querySelector('.line-highlight[data-range="' + e + '"]') ||
|
||
document.createElement('div')
|
||
if (
|
||
(v.push(function () {
|
||
r.setAttribute('aria-hidden', 'true'),
|
||
r.setAttribute('data-range', e),
|
||
(r.className = (c || '') + ' line-highlight')
|
||
}),
|
||
p && Prism.plugins.lineNumbers)
|
||
) {
|
||
var s = Prism.plugins.lineNumbers.getLine(o, i),
|
||
l = Prism.plugins.lineNumbers.getLine(o, n)
|
||
if (s) {
|
||
var a = s.offsetTop + A + 'px'
|
||
v.push(function () {
|
||
r.style.top = a
|
||
})
|
||
}
|
||
if (l) {
|
||
var u = l.offsetTop - s.offsetTop + l.offsetHeight + 'px'
|
||
v.push(function () {
|
||
r.style.height = u
|
||
})
|
||
}
|
||
} else
|
||
v.push(function () {
|
||
r.setAttribute('data-start', String(i)),
|
||
n > i && r.setAttribute('data-end', String(n)),
|
||
(r.style.top = (i - d - 1) * f + A + 'px'),
|
||
(r.textContent = new Array(n - i + 2).join(' \n'))
|
||
})
|
||
v.push(function () {
|
||
r.style.width = o.scrollWidth + 'px'
|
||
}),
|
||
v.push(function () {
|
||
m.appendChild(r)
|
||
})
|
||
}
|
||
})
|
||
var P = o.id
|
||
if (p && Prism.util.isActive(o, i) && P) {
|
||
l(o, i) ||
|
||
v.push(function () {
|
||
o.classList.add(i)
|
||
})
|
||
var E = parseInt(o.getAttribute('data-start') || '1')
|
||
s('.line-numbers-rows > span', o).forEach(function (e, t) {
|
||
var i = t + E
|
||
e.onclick = function () {
|
||
var e = P + '.' + i
|
||
;(r = !1),
|
||
(location.hash = e),
|
||
setTimeout(function () {
|
||
r = !0
|
||
}, 1)
|
||
}
|
||
})
|
||
}
|
||
return function () {
|
||
v.forEach(a)
|
||
}
|
||
},
|
||
}
|
||
var o = 0
|
||
Prism.hooks.add('before-sanity-check', function (e) {
|
||
var t = e.element.parentElement
|
||
if (u(t)) {
|
||
var i = 0
|
||
s('.line-highlight', t).forEach(function (e) {
|
||
;(i += e.textContent.length), e.parentNode.removeChild(e)
|
||
}),
|
||
i &&
|
||
/^(?: \n)+$/.test(e.code.slice(-i)) &&
|
||
(e.code = e.code.slice(0, -i))
|
||
}
|
||
}),
|
||
Prism.hooks.add('complete', function e(i) {
|
||
var n = i.element.parentElement
|
||
if (u(n)) {
|
||
clearTimeout(o)
|
||
var r = Prism.plugins.lineNumbers,
|
||
s = i.plugins && i.plugins.lineNumbers
|
||
l(n, t) && r && !s
|
||
? Prism.hooks.add('line-numbers', e)
|
||
: (Prism.plugins.lineHighlight.highlightLines(n)(),
|
||
(o = setTimeout(c, 1)))
|
||
}
|
||
}),
|
||
window.addEventListener('hashchange', c),
|
||
window.addEventListener('resize', function () {
|
||
s('pre')
|
||
.filter(u)
|
||
.map(function (e) {
|
||
return Prism.plugins.lineHighlight.highlightLines(e)
|
||
})
|
||
.forEach(a)
|
||
})
|
||
}
|
||
function s(e, t) {
|
||
return Array.prototype.slice.call((t || document).querySelectorAll(e))
|
||
}
|
||
function l(e, t) {
|
||
return e.classList.contains(t)
|
||
}
|
||
function a(e) {
|
||
e()
|
||
}
|
||
function u(e) {
|
||
return !!(
|
||
e &&
|
||
/pre/i.test(e.nodeName) &&
|
||
(e.hasAttribute('data-line') || (e.id && Prism.util.isActive(e, i)))
|
||
)
|
||
}
|
||
function c() {
|
||
var e = location.hash.slice(1)
|
||
s('.temporary.line-highlight').forEach(function (e) {
|
||
e.parentNode.removeChild(e)
|
||
})
|
||
var t = (e.match(/\.([\d,-]+)$/) || [, ''])[1]
|
||
if (t && !document.getElementById(e)) {
|
||
var i = e.slice(0, e.lastIndexOf('.')),
|
||
n = document.getElementById(i)
|
||
n &&
|
||
(n.hasAttribute('data-line') || n.setAttribute('data-line', ''),
|
||
Prism.plugins.lineHighlight.highlightLines(n, t, 'temporary ')(),
|
||
r &&
|
||
document.querySelector('.temporary.line-highlight').scrollIntoView())
|
||
}
|
||
}
|
||
})()
|
||
!(function () {
|
||
if ('undefined' != typeof Prism && 'undefined' != typeof document) {
|
||
var e = 'line-numbers',
|
||
n = /\n(?!$)/g,
|
||
t = (Prism.plugins.lineNumbers = {
|
||
getLine: function (n, t) {
|
||
if ('PRE' === n.tagName && n.classList.contains(e)) {
|
||
var i = n.querySelector('.line-numbers-rows')
|
||
if (i) {
|
||
var r = parseInt(n.getAttribute('data-start'), 10) || 1,
|
||
s = r + (i.children.length - 1)
|
||
t < r && (t = r), t > s && (t = s)
|
||
var l = t - r
|
||
return i.children[l]
|
||
}
|
||
}
|
||
},
|
||
resize: function (e) {
|
||
r([e])
|
||
},
|
||
assumeViewportIndependence: !0,
|
||
}),
|
||
i = void 0
|
||
window.addEventListener('resize', function () {
|
||
;(t.assumeViewportIndependence && i === window.innerWidth) ||
|
||
((i = window.innerWidth),
|
||
r(
|
||
Array.prototype.slice.call(
|
||
document.querySelectorAll('pre.line-numbers')
|
||
)
|
||
))
|
||
}),
|
||
Prism.hooks.add('complete', function (t) {
|
||
if (t.code) {
|
||
var i = t.element,
|
||
s = i.parentNode
|
||
if (
|
||
s &&
|
||
/pre/i.test(s.nodeName) &&
|
||
!i.querySelector('.line-numbers-rows') &&
|
||
Prism.util.isActive(i, e)
|
||
) {
|
||
i.classList.remove(e), s.classList.add(e)
|
||
var l,
|
||
o = t.code.match(n),
|
||
a = o ? o.length + 1 : 1,
|
||
u = new Array(a + 1).join('<span></span>')
|
||
;(l = document.createElement('span')).setAttribute(
|
||
'aria-hidden',
|
||
'true'
|
||
),
|
||
(l.className = 'line-numbers-rows'),
|
||
(l.innerHTML = u),
|
||
s.hasAttribute('data-start') &&
|
||
(s.style.counterReset =
|
||
'linenumber ' +
|
||
(parseInt(s.getAttribute('data-start'), 10) - 1)),
|
||
t.element.appendChild(l),
|
||
r([s]),
|
||
Prism.hooks.run('line-numbers', t)
|
||
}
|
||
}
|
||
}),
|
||
Prism.hooks.add('line-numbers', function (e) {
|
||
;(e.plugins = e.plugins || {}), (e.plugins.lineNumbers = !0)
|
||
})
|
||
}
|
||
function r(e) {
|
||
if (
|
||
0 !=
|
||
(e = e.filter(function (e) {
|
||
var n,
|
||
t = ((n = e),
|
||
n
|
||
? window.getComputedStyle
|
||
? getComputedStyle(n)
|
||
: n.currentStyle || null
|
||
: null)['white-space']
|
||
return 'pre-wrap' === t || 'pre-line' === t
|
||
})).length
|
||
) {
|
||
var t = e
|
||
.map(function (e) {
|
||
var t = e.querySelector('code'),
|
||
i = e.querySelector('.line-numbers-rows')
|
||
if (t && i) {
|
||
var r = e.querySelector('.line-numbers-sizer'),
|
||
s = t.textContent.split(n)
|
||
r ||
|
||
(((r = document.createElement('span')).className =
|
||
'line-numbers-sizer'),
|
||
t.appendChild(r)),
|
||
(r.innerHTML = '0'),
|
||
(r.style.display = 'block')
|
||
var l = r.getBoundingClientRect().height
|
||
return (
|
||
(r.innerHTML = ''),
|
||
{
|
||
element: e,
|
||
lines: s,
|
||
lineHeights: [],
|
||
oneLinerHeight: l,
|
||
sizer: r,
|
||
}
|
||
)
|
||
}
|
||
})
|
||
.filter(Boolean)
|
||
t.forEach(function (e) {
|
||
var n = e.sizer,
|
||
t = e.lines,
|
||
i = e.lineHeights,
|
||
r = e.oneLinerHeight
|
||
;(i[t.length - 1] = void 0),
|
||
t.forEach(function (e, t) {
|
||
if (e && e.length > 1) {
|
||
var s = n.appendChild(document.createElement('span'))
|
||
;(s.style.display = 'block'), (s.textContent = e)
|
||
} else i[t] = r
|
||
})
|
||
}),
|
||
t.forEach(function (e) {
|
||
for (
|
||
var n = e.sizer, t = e.lineHeights, i = 0, r = 0;
|
||
r < t.length;
|
||
r++
|
||
)
|
||
void 0 === t[r] &&
|
||
(t[r] = n.children[i++].getBoundingClientRect().height)
|
||
}),
|
||
t.forEach(function (e) {
|
||
var n = e.sizer,
|
||
t = e.element.querySelector('.line-numbers-rows')
|
||
;(n.style.display = 'none'),
|
||
(n.innerHTML = ''),
|
||
e.lineHeights.forEach(function (e, n) {
|
||
t.children[n].style.height = e + 'px'
|
||
})
|
||
})
|
||
}
|
||
}
|
||
})()
|
||
!(function () {
|
||
if ('undefined' != typeof Prism && 'undefined' != typeof document) {
|
||
var e = /(?:^|\s)command-line(?:\s|$)/,
|
||
t = 'command-line-prompt',
|
||
n = ''.startsWith
|
||
? function (e, t) {
|
||
return e.startsWith(t)
|
||
}
|
||
: function (e, t) {
|
||
return 0 === e.indexOf(t)
|
||
},
|
||
a = ''.endsWith
|
||
? function (e, t) {
|
||
return e.endsWith(t)
|
||
}
|
||
: function (e, t) {
|
||
var n = e.length
|
||
return e.substring(n - t.length, n) === t
|
||
}
|
||
Prism.hooks.add('before-highlight', function (i) {
|
||
var o = r(i)
|
||
if (!o.complete && i.code) {
|
||
var s = i.element.parentElement
|
||
if (
|
||
s &&
|
||
/pre/i.test(s.nodeName) &&
|
||
(e.test(s.className) || e.test(i.element.className))
|
||
) {
|
||
var l = i.element.querySelector('.' + t)
|
||
l && l.remove()
|
||
var m = i.code.split('\n')
|
||
o.numberOfLines = m.length
|
||
var u = (o.outputLines = []),
|
||
c = s.getAttribute('data-output'),
|
||
d = s.getAttribute('data-filter-output')
|
||
if (null !== c)
|
||
c.split(',').forEach(function (e) {
|
||
var t = e.split('-'),
|
||
n = parseInt(t[0], 10),
|
||
a = 2 === t.length ? parseInt(t[1], 10) : n
|
||
if (!isNaN(n) && !isNaN(a)) {
|
||
n < 1 && (n = 1), a > m.length && (a = m.length), a--
|
||
for (var r = --n; r <= a; r++) (u[r] = m[r]), (m[r] = '')
|
||
}
|
||
})
|
||
else if (d)
|
||
for (var p = 0; p < m.length; p++)
|
||
n(m[p], d) && ((u[p] = m[p].slice(d.length)), (m[p] = ''))
|
||
for (
|
||
var f = (o.continuationLineIndicies = new Set()),
|
||
h = s.getAttribute('data-continuation-str'),
|
||
v = s.getAttribute('data-filter-continuation'),
|
||
g = 0;
|
||
g < m.length;
|
||
g++
|
||
) {
|
||
var b = m[g]
|
||
b &&
|
||
(h && a(b, h) && f.add(g + 1),
|
||
g > 0 && v && n(b, v) && ((m[g] = b.slice(v.length)), f.add(g)))
|
||
}
|
||
i.code = m.join('\n')
|
||
} else o.complete = !0
|
||
} else o.complete = !0
|
||
}),
|
||
Prism.hooks.add('before-insert', function (e) {
|
||
var t = r(e)
|
||
if (!t.complete) {
|
||
for (
|
||
var n = e.highlightedCode.split('\n'),
|
||
a = t.outputLines || [],
|
||
i = 0,
|
||
o = n.length;
|
||
i < o;
|
||
i++
|
||
)
|
||
a.hasOwnProperty(i)
|
||
? (n[i] =
|
||
'<span class="token output">' +
|
||
Prism.util.encode(a[i]) +
|
||
'</span>')
|
||
: (n[i] = '<span class="token command">' + n[i] + '</span>')
|
||
e.highlightedCode = n.join('\n')
|
||
}
|
||
}),
|
||
Prism.hooks.add('complete', function (n) {
|
||
if (
|
||
(function (e) {
|
||
return 'command-line' in (e.vars = e.vars || {})
|
||
})(n)
|
||
) {
|
||
var a = r(n)
|
||
if (!a.complete) {
|
||
var i = n.element.parentElement
|
||
e.test(n.element.className) &&
|
||
(n.element.className = n.element.className.replace(e, ' ')),
|
||
e.test(i.className) || (i.className += ' command-line')
|
||
var o,
|
||
s = '',
|
||
l = a.numberOfLines || 0,
|
||
m = b('data-prompt', '')
|
||
o =
|
||
'' !== m
|
||
? '<span data-prompt="' + m + '"></span>'
|
||
: '<span data-user="' +
|
||
b('data-user', 'user') +
|
||
'" data-host="' +
|
||
b('data-host', 'localhost') +
|
||
'"></span>'
|
||
for (
|
||
var u = a.continuationLineIndicies || new Set(),
|
||
c =
|
||
'<span data-continuation-prompt="' +
|
||
b('data-continuation-prompt', '>') +
|
||
'"></span>',
|
||
d = 0;
|
||
d < l;
|
||
d++
|
||
)
|
||
u.has(d) ? (s += c) : (s += o)
|
||
var p = document.createElement('span')
|
||
;(p.className = t), (p.innerHTML = s)
|
||
for (var f = a.outputLines || [], h = 0, v = f.length; h < v; h++)
|
||
if (f.hasOwnProperty(h)) {
|
||
var g = p.children[h]
|
||
g.removeAttribute('data-user'),
|
||
g.removeAttribute('data-host'),
|
||
g.removeAttribute('data-prompt')
|
||
}
|
||
n.element.insertBefore(p, n.element.firstChild), (a.complete = !0)
|
||
}
|
||
}
|
||
function b(e, t) {
|
||
return (i.getAttribute(e) || t).replace(/"/g, '"')
|
||
}
|
||
})
|
||
}
|
||
function r(e) {
|
||
var t = (e.vars = e.vars || {})
|
||
return (t['command-line'] = t['command-line'] || {})
|
||
}
|
||
})()
|
||
!(function () {
|
||
if ('undefined' != typeof Prism) {
|
||
var e =
|
||
Object.assign ||
|
||
function (e, t) {
|
||
for (var n in t) t.hasOwnProperty(n) && (e[n] = t[n])
|
||
return e
|
||
},
|
||
t = {
|
||
'remove-trailing': 'boolean',
|
||
'remove-indent': 'boolean',
|
||
'left-trim': 'boolean',
|
||
'right-trim': 'boolean',
|
||
'break-lines': 'number',
|
||
indent: 'number',
|
||
'remove-initial-line-feed': 'boolean',
|
||
'tabs-to-spaces': 'number',
|
||
'spaces-to-tabs': 'number',
|
||
}
|
||
;(n.prototype = {
|
||
setDefaults: function (t) {
|
||
this.defaults = e(this.defaults, t)
|
||
},
|
||
normalize: function (t, n) {
|
||
for (var r in (n = e(this.defaults, n))) {
|
||
var i = r.replace(/-(\w)/g, function (e, t) {
|
||
return t.toUpperCase()
|
||
})
|
||
'normalize' !== r &&
|
||
'setDefaults' !== i &&
|
||
n[r] &&
|
||
this[i] &&
|
||
(t = this[i].call(this, t, n[r]))
|
||
}
|
||
return t
|
||
},
|
||
leftTrim: function (e) {
|
||
return e.replace(/^\s+/, '')
|
||
},
|
||
rightTrim: function (e) {
|
||
return e.replace(/\s+$/, '')
|
||
},
|
||
tabsToSpaces: function (e, t) {
|
||
return (t = 0 | t || 4), e.replace(/\t/g, new Array(++t).join(' '))
|
||
},
|
||
spacesToTabs: function (e, t) {
|
||
return (t = 0 | t || 4), e.replace(RegExp(' {' + t + '}', 'g'), '\t')
|
||
},
|
||
removeTrailing: function (e) {
|
||
return e.replace(/\s*?$/gm, '')
|
||
},
|
||
removeInitialLineFeed: function (e) {
|
||
return e.replace(/^(?:\r?\n|\r)/, '')
|
||
},
|
||
removeIndent: function (e) {
|
||
var t = e.match(/^[^\S\n\r]*(?=\S)/gm)
|
||
return t && t[0].length
|
||
? (t.sort(function (e, t) {
|
||
return e.length - t.length
|
||
}),
|
||
t[0].length ? e.replace(RegExp('^' + t[0], 'gm'), '') : e)
|
||
: e
|
||
},
|
||
indent: function (e, t) {
|
||
return e.replace(
|
||
/^[^\S\n\r]*(?=\S)/gm,
|
||
new Array(++t).join('\t') + '$&'
|
||
)
|
||
},
|
||
breakLines: function (e, t) {
|
||
t = !0 === t ? 80 : 0 | t || 80
|
||
for (var n = e.split('\n'), i = 0; i < n.length; ++i)
|
||
if (!(r(n[i]) <= t)) {
|
||
for (
|
||
var o = n[i].split(/(\s+)/g), a = 0, l = 0;
|
||
l < o.length;
|
||
++l
|
||
) {
|
||
var s = r(o[l])
|
||
;(a += s) > t && ((o[l] = '\n' + o[l]), (a = s))
|
||
}
|
||
n[i] = o.join('')
|
||
}
|
||
return n.join('\n')
|
||
},
|
||
}),
|
||
'undefined' != typeof module && module.exports && (module.exports = n),
|
||
(Prism.plugins.NormalizeWhitespace = new n({
|
||
'remove-trailing': !0,
|
||
'remove-indent': !0,
|
||
'left-trim': !0,
|
||
'right-trim': !0,
|
||
})),
|
||
Prism.hooks.add('before-sanity-check', function (e) {
|
||
var n = Prism.plugins.NormalizeWhitespace
|
||
if (
|
||
(!e.settings || !1 !== e.settings['whitespace-normalization']) &&
|
||
Prism.util.isActive(e.element, 'whitespace-normalization', !0)
|
||
)
|
||
if ((e.element && e.element.parentNode) || !e.code) {
|
||
var r = e.element.parentNode
|
||
if (e.code && r && 'pre' === r.nodeName.toLowerCase()) {
|
||
for (var i in (null == e.settings && (e.settings = {}), t))
|
||
if (Object.hasOwnProperty.call(t, i)) {
|
||
var o = t[i]
|
||
if (r.hasAttribute('data-' + i))
|
||
try {
|
||
var a = JSON.parse(r.getAttribute('data-' + i) || 'true')
|
||
typeof a === o && (e.settings[i] = a)
|
||
} catch (e) {}
|
||
}
|
||
for (
|
||
var l = r.childNodes, s = '', c = '', u = !1, m = 0;
|
||
m < l.length;
|
||
++m
|
||
) {
|
||
var f = l[m]
|
||
f == e.element
|
||
? (u = !0)
|
||
: '#text' === f.nodeName &&
|
||
(u ? (c += f.nodeValue) : (s += f.nodeValue),
|
||
r.removeChild(f),
|
||
--m)
|
||
}
|
||
if (e.element.children.length && Prism.plugins.KeepMarkup) {
|
||
var d = s + e.element.innerHTML + c
|
||
;(e.element.innerHTML = n.normalize(d, e.settings)),
|
||
(e.code = e.element.textContent)
|
||
} else
|
||
(e.code = s + e.code + c),
|
||
(e.code = n.normalize(e.code, e.settings))
|
||
}
|
||
} else e.code = n.normalize(e.code, e.settings)
|
||
})
|
||
}
|
||
function n(t) {
|
||
this.defaults = e({}, t)
|
||
}
|
||
function r(e) {
|
||
for (var t = 0, n = 0; n < e.length; ++n)
|
||
e.charCodeAt(n) == '\t'.charCodeAt(0) && (t += 3)
|
||
return e.length + t
|
||
}
|
||
})()
|